From fdc3200ef4718eb98bd8a713f956222a9bf85ac9 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 4 Aug 2022 16:40:44 +0200 Subject: docs: Add initial version of Docusaurus based docs This change updates the repository with a new Docusaurus-based documentation website. This allows us to create our documentation using Markdown, MDX and React. This will serve as the main entry point for users visiting https://opendc.org. The actual OpenDC application will be moved to https://app.opendc.org. --- site/docusaurus.config.js | 147 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 site/docusaurus.config.js (limited to 'site/docusaurus.config.js') diff --git a/site/docusaurus.config.js b/site/docusaurus.config.js new file mode 100644 index 00000000..2e72615f --- /dev/null +++ b/site/docusaurus.config.js @@ -0,0 +1,147 @@ +// @ts-check +// Note: type annotations allow type checking and IDEs autocompletion + +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: "https://opendc.org", + baseUrl: "/", + onBrokenLinks: "throw", + onBrokenMarkdownLinks: "warn", + favicon: "img/favicon.ico", + organizationName: "atlarge-research", + projectName: "opendc", + + i18n: { + defaultLocale: "en", + locales: ["en"] + }, + + presets: [ + [ + "classic", + /** @type {import("@docusaurus/preset-classic").Options} */ + ({ + docs: { + sidebarPath: require.resolve("./sidebars.js"), + editUrl: "https://github.com/atlarge-research/opendc/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/atlarge-research/opendc/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/atlarge-research/opendc", + 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/atlarge-research/opendc/discussions" + } + ] + }, + { + title: "More", + items: [ + { + label: "GitHub", + href: "https://github.com/atlarge-research/opendc" + } + ] + } + ], + copyright: `Copyright © ${new Date().getFullYear()} AtLarge Research. Built with Docusaurus.` + }, + prism: { + theme: lightCodeTheme, + darkTheme: darkCodeTheme + } + }) +}; + +module.exports = config; -- cgit v1.2.3 From fd208941622cd559a0c3a196a0754a1b33db402b Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 12 Sep 2022 20:27:23 +0200 Subject: ci(site): Add GitHub Actions workflow for deploying website This change adds a new GitHub Actions workflow for building and deploying the OpenDC website (documentation) built using Docusaurus. --- site/docusaurus.config.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'site/docusaurus.config.js') diff --git a/site/docusaurus.config.js b/site/docusaurus.config.js index 2e72615f..0074093e 100644 --- a/site/docusaurus.config.js +++ b/site/docusaurus.config.js @@ -1,5 +1,7 @@ // @ts-check -// Note: type annotations allow type checking and IDEs autocompletion + +const organizationName = "atlarge-research"; +const projectName = "opendc"; const lightCodeTheme = require("prism-react-renderer/themes/github"); const darkCodeTheme = require("prism-react-renderer/themes/dracula"); @@ -8,13 +10,13 @@ const darkCodeTheme = require("prism-react-renderer/themes/dracula"); const config = { title: "OpenDC", tagline: "Collaborative Datacenter Simulation and Exploration for Everybody", - url: "https://opendc.org", - baseUrl: "/", + 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: "atlarge-research", - projectName: "opendc", + organizationName, + projectName, i18n: { defaultLocale: "en", @@ -28,7 +30,7 @@ const config = { ({ docs: { sidebarPath: require.resolve("./sidebars.js"), - editUrl: "https://github.com/atlarge-research/opendc/tree/master/site/" + editUrl: `https://github.com/${organizationName}/${projectName}/tree/master/site/` }, theme: { customCss: require.resolve("./src/css/custom.css") @@ -45,7 +47,7 @@ const config = { id: "community", path: "community", routeBasePath: "community", - editUrl: "https://github.com/atlarge-research/opendc/tree/master/site/", + editUrl: `https://github.com/${organizationName}/${projectName}/tree/master/site/`, sidebarPath: require.resolve("./sidebars.js") }) ] @@ -58,7 +60,7 @@ const config = { title: "OpenDC", logo: { alt: "OpenDC logo", - src: "img/logo.svg" + src: "/img/logo.svg" }, items: [ { @@ -81,7 +83,7 @@ const config = { "aria-label": "OpenDC web application", }, { - href: "https://github.com/atlarge-research/opendc", + href: `https://github.com/${organizationName}/${projectName}`, position: "right", className: "header-github-link", "aria-label": "GitHub repository", @@ -121,7 +123,7 @@ const config = { }, { label: "GitHub Discussions", - href: "https://github.com/atlarge-research/opendc/discussions" + href: `https://github.com/${organizationName}/${projectName}/discussions` } ] }, @@ -130,7 +132,7 @@ const config = { items: [ { label: "GitHub", - href: "https://github.com/atlarge-research/opendc" + href: `https://github.com/${organizationName}/${projectName}` } ] } -- cgit v1.2.3