summaryrefslogtreecommitdiff
path: root/site/docusaurus.config.js
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-09-13 17:28:57 +0200
committerGitHub <noreply@github.com>2022-09-13 17:28:57 +0200
commitff7dfda051e0103b0df453473eb0f08cdc37ae85 (patch)
tree2e80525809ecb5afe010faa99898ca479965b95a /site/docusaurus.config.js
parentfde9ba4fb88bada9d9873ba21904e9e1a66b0c46 (diff)
parentfd208941622cd559a0c3a196a0754a1b33db402b (diff)
merge: Add documentation using Docusaurus (#97)
This pull request implements the new OpenDC documentation website using Docusaurus 2. ## Implementation Notes :hammer_and_pick: * Add initial Docusaurus website. * Migrate existing docs to Docusaurus. * Configure Prettier for Docusaurus. * Add tutorials to OpenDC website (#28) * Add deployment workflow via GitHub actions ## External Dependencies :four_leaf_clover: * Docusaurus 2 Closes #28
Diffstat (limited to 'site/docusaurus.config.js')
-rw-r--r--site/docusaurus.config.js149
1 files changed, 149 insertions, 0 deletions
diff --git a/site/docusaurus.config.js b/site/docusaurus.config.js
new file mode 100644
index 00000000..0074093e
--- /dev/null
+++ b/site/docusaurus.config.js
@@ -0,0 +1,149 @@
+// @ts-check
+
+const organizationName = "atlarge-research";
+const projectName = "opendc";
+
+const lightCodeTheme = require("prism-react-renderer/themes/github");
+const darkCodeTheme = require("prism-react-renderer/themes/dracula");
+
+/** @type {import("@docusaurus/types").Config} */
+const config = {
+ title: "OpenDC",
+ tagline: "Collaborative Datacenter Simulation and Exploration for Everybody",
+ url: process.env.DOCUSAURUS_URL || `https://${organizationName}.github.io`,
+ baseUrl: process.env.DOCUSAURUS_BASE_PATH || `/${projectName}/`,
+ onBrokenLinks: "throw",
+ onBrokenMarkdownLinks: "warn",
+ favicon: "img/favicon.ico",
+ organizationName,
+ projectName,
+
+ i18n: {
+ defaultLocale: "en",
+ locales: ["en"]
+ },
+
+ presets: [
+ [
+ "classic",
+ /** @type {import("@docusaurus/preset-classic").Options} */
+ ({
+ docs: {
+ sidebarPath: require.resolve("./sidebars.js"),
+ editUrl: `https://github.com/${organizationName}/${projectName}/tree/master/site/`
+ },
+ theme: {
+ customCss: require.resolve("./src/css/custom.css")
+ }
+ })
+ ]
+ ],
+
+ plugins: [
+ [
+ "content-docs",
+ /** @type {import("@docusaurus/plugin-content-docs").Options} */
+ ({
+ id: "community",
+ path: "community",
+ routeBasePath: "community",
+ editUrl: `https://github.com/${organizationName}/${projectName}/tree/master/site/`,
+ sidebarPath: require.resolve("./sidebars.js")
+ })
+ ]
+ ],
+
+ themeConfig:
+ /** @type {import("@docusaurus/preset-classic").ThemeConfig} */
+ ({
+ navbar: {
+ title: "OpenDC",
+ logo: {
+ alt: "OpenDC logo",
+ src: "/img/logo.svg"
+ },
+ items: [
+ {
+ type: "doc",
+ docId: "intro",
+ position: "left",
+ label: "Learn"
+ },
+ {
+ to: "/community/support",
+ label: "Community",
+ position: "left",
+ activeBaseRegex: `/community/`
+ },
+ {
+ href: "https://app.opendc.org",
+ html: "Log In",
+ position: "right",
+ className: "header-app-link button button--outline button--primary",
+ "aria-label": "OpenDC web application",
+ },
+ {
+ href: `https://github.com/${organizationName}/${projectName}`,
+ position: "right",
+ className: "header-github-link",
+ "aria-label": "GitHub repository",
+ },
+ ]
+ },
+ footer: {
+ style: "dark",
+ links: [
+ {
+ title: "Learn",
+ items: [
+ {
+ label: "Getting Started",
+ to: "/docs/category/getting-started"
+ },
+ {
+ label: "Tutorials",
+ to: "/docs/category/tutorials"
+ },
+ {
+ label: "Advanced Guides",
+ to: "/docs/category/advanced-guides"
+ }
+ ]
+ },
+ {
+ title: "Community",
+ items: [
+ {
+ label: "Support",
+ to: "/community/support"
+ },
+ {
+ label: "Team",
+ to: "/community/team"
+ },
+ {
+ label: "GitHub Discussions",
+ href: `https://github.com/${organizationName}/${projectName}/discussions`
+ }
+ ]
+ },
+ {
+ title: "More",
+ items: [
+ {
+ label: "GitHub",
+ href: `https://github.com/${organizationName}/${projectName}`
+ }
+ ]
+ }
+ ],
+ copyright: `Copyright © ${new Date().getFullYear()} AtLarge Research. Built with Docusaurus.`
+ },
+ prism: {
+ theme: lightCodeTheme,
+ darkTheme: darkCodeTheme
+ }
+ })
+};
+
+module.exports = config;