Skip to content

Sync config files from main Docusaurus repo #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
300 changes: 159 additions & 141 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,183 +1,201 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

// Change here to customise config

// Name of the Github Repo, it's also the baseUrl
const workshopName = 'intro-lab';
// Change this if hosting outside mongodb-developer
const organizationName = "mongodb-developer";

// Main page config
// Main Page Features
// UTM stuff
// Footer links (probably no need to change them)
///////////////////////////////////////////////////////////////////////////////
// DON'T CHANGE ANYTHING BELOW UNLESS YOU KNOW WHAT YOU'RE DOING //
///////////////////////////////////////////////////////////////////////////////
/** @type {import('@docusaurus/types').Config} */
/** @type {import('@docusaurus/preset-classic').Options} */
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
const workshopName = "intro-lab";
const organizationName = "mongodb-developer";
const title = "Intro Lab";
const tagLine = "Set up your MongoDB cluster, import the sample data, and get started with MongoDB Atlas.";
const startButtonTitle = "Come on in!";
const favicon = "/img/favicon.svg"
const favicon = "/img/favicon.svg";

const featureList = [{
title: "Hands-On Experiences",
illustration: "img/coding.png",

// Main Page Features
const featureList = [
{
title: 'Hands-On Experiences',
illustration: 'img/coding.png',
description: `
Learn by doing, not by reading.
`,
},
{
title: 'Amazing Instructors',
illustration: 'img/highfive.png',
`
}, {
title: "Amazing Instructors",
illustration: "img/highfive.png",

description: `
Build it with the help of our amazing instructors, or just do it on your own.
`,
},
{
title: 'Take-Home Material',
illustration: 'img/writing.png',
`
}, {
title: "Take-Home Material",
illustration: "img/writing.png",

description: `
Take home the material and keep learning.
`,
},
];

// UTM stuff

const utmAdvocateName = 'project.phoenix';
const utmWorkshopName = 'developer.day';
`
}];

const utmAdvocateName = "project.phoenix";
const utmWorkshopName = "developer.day";
const utmParams = `utm_campaign=devrel&utm_source=workshop&utm_medium=cta&utm_content=${utmWorkshopName}&utm_term=${utmAdvocateName}`;

// Footer links (probably no need to change them)

const footerLinks = [
{
const footerLinks = [{
label: "Try MongoDB Atlas",
href: `https://www.mongodb.com/try?${utmParams}`,
},
{
href: `https://www.mongodb.com/try?${utmParams}`
}, {
label: "Forums",
href: `https://www.mongodb.com/community/forums/${utmParams}`,
},
{
href: `https://www.mongodb.com/community/forums/${utmParams}`
}, {
label: "Developer Center",
href: `https://www.mongodb.com/developer/${utmParams}`,
},
{
href: `https://www.mongodb.com/developer/${utmParams}`
}, {
label: "MongoDB University",
href: `https://learn.mongodb.com/${utmParams}`,
},
{
href: `https://learn.mongodb.com/${utmParams}`
}, {
href: `https://github.com/${organizationName}/${workshopName}`,
label: "This lab in GitHub",
},
{
label: "This lab in GitHub"
}, {
label: `© ${new Date().getFullYear()} MongoDB, Inc.`,
href: "#",
},
];
href: "#"
}];

///////////////////////////////////////////////////////////////////////////////
// DON'T CHANGE ANYTHING BELOW UNLESS YOU KNOW WHAT YOU'RE DOING //
///////////////////////////////////////////////////////////////////////////////
const {
themes
} = require("prism-react-renderer");

const { themes } = require("prism-react-renderer");
const lightCodeTheme = themes.github;
const darkCodeTheme = themes.dracula;

/** @type {import('@docusaurus/types').Config} */
const config = {
title: `${title}`,
tagline: `${tagLine}`,
url: `https://${workshopName}.github.io`,
baseUrl: `/${workshopName}/`,
projectName: `${organizationName}.github.io`,
organizationName: `${organizationName}`,
trailingSlash: false,
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: `${favicon}`,
deploymentBranch: "gh-pages",
staticDirectories: ["static"],
i18n: {
defaultLocale: "en",
locales: ["en", "zh"],
},
customFields: {
startButtonTitle: `${startButtonTitle}`,
featureList: featureList,
utmParams,
},
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
title: `${title}`,
tagline: `${tagLine}`,
url: `https://${workshopName}.github.io`,
baseUrl: `/${workshopName}/`,
projectName: `${organizationName}.github.io`,
organizationName: `${organizationName}`,
trailingSlash: false,
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: `${favicon}`,
deploymentBranch: "gh-pages",
staticDirectories: ["static"],

i18n: {
defaultLocale: "en",
locales: ["en", "zh"]
},

customFields: {
startButtonTitle: `${startButtonTitle}`,
featureList: featureList,
utmParams
},

presets: [["classic", ({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
editUrl: `https://github.com/${organizationName}/${workshopName}/blob/main`,
sidebarPath: require.resolve("./sidebars.js"),
editUrl: `https://github.com/${organizationName}/${workshopName}/blob/main`
},

theme: {
customCss: require.resolve("./src/css/custom.css"),
customCss: require.resolve("./src/css/custom.css")
},

gtag: {
trackingID: "G-ZJ28V71VTQ",
anonymizeIP: true,
trackingID: "G-ZJ28V71VTQ",
anonymizeIP: true
}
})]],

plugins: [require.resolve("docusaurus-lunr-search")],

themeConfig: ({
docs: {
sidebar: {
autoCollapseCategories: true,
hideable: true
}
},

announcementBar: undefined,

navbar: {
title: `${title}`,

logo: {
alt: "MongoDB Logo",
src: "/img/logo.svg",
srcDark: "/img/logo-dark.svg",
className: "navbar-logo",
width: "135px",
height: "100%"
},

items: [{
label: "🤖 AI Lab Assistant",
href: "https://mdb.link/lab-assistant",
position: "right"
}, {
type: "localeDropdown",
position: "right"
}]
},
}),
],
],
plugins: [require.resolve("docusaurus-lunr-search")],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
docs: {
sidebar: {
autoCollapseCategories: true,
hideable: true,

footer: {
style: "dark",
links: footerLinks
},
},
announcementBar: undefined,
navbar: {
title: `${title}`,
logo: {
alt: "MongoDB Logo",
src: "/img/logo.svg",
srcDark: "/img/logo-dark.svg",
className: "navbar-logo",
width: "135px",
height: "100%",

prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ["powershell", "swift", "kotlin"]
},
items: [
{
label: "🤖 AI Lab Assistant",
href: "https://mdb.link/lab-assistant",
position: "right",
},
{
type: "localeDropdown",
position: "right",
},
],
},
footer: {
style: "dark",
links: footerLinks,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ["powershell", "swift", "kotlin"],
},
mermaid: {
theme: { light: "neutral", dark: "forest" },
},

mermaid: {
theme: {
light: "neutral",
dark: "forest"
}
}
}),
future: {
experimental_faster: true,
},
markdown: {
mermaid: true,
},
themes: ["@docusaurus/theme-mermaid"],

future: {
v4: {
removeLegacyPostBuildHeadAttribute: true,
useCssCascadeLayers: true
},

experimental_faster: {
swcJsLoader: true,
swcJsMinimizer: true,
swcHtmlMinimizer: true,
lightningCssMinimizer: true,
rspackBundler: true,
rspackPersistentCache: true,
ssgWorkerThreads: true,
mdxCrossCompilerCache: true
},

experimental_storage: {
type: "localStorage",
namespace: true
}
},

markdown: {
mermaid: true
},

themes: ["@docusaurus/theme-mermaid"]
};

module.exports = config;
module.exports = config;
Loading