Skip to content

Commit

Permalink
migrate to Docusaurus 2.0.1
Browse files Browse the repository at this point in the history
we were still using an early alpha version (2.0.0-alpha.50)
  • Loading branch information
mistermicheels committed Aug 14, 2022
1 parent b4f83aa commit a4aef4d
Show file tree
Hide file tree
Showing 12 changed files with 18,635 additions and 11,018 deletions.
2 changes: 1 addition & 1 deletion _scripts/generate-sitemap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// we generate the sitemap ourselves as Docusaurus currently doesn't do it
// we generate the sitemap ourselves with some customizations
// run this after the Docusaurus build so it doesn't get overwritten

const { SitemapStream, streamToPromise } = require("sitemap");
Expand Down
2 changes: 1 addition & 1 deletion _scripts/write-website-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function writeSidebarsFile() {
{
type: "category",
label: "About",
items: ["about/about", "about/contributing"]
items: ["about/about-note", "about/contributing"]
},
...sidebarItemsForNotes
]
Expand Down
2 changes: 1 addition & 1 deletion _website/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Website

This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

The actual contents (plus some files depending on them) are written by higher-level scripts.
3 changes: 3 additions & 0 deletions _website/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
22 changes: 0 additions & 22 deletions _website/collapse-sidebar-again-if-js-enabled-plugin.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: About these notes
slug: about
---

These are some notes regarding things I have learned.
Expand Down
114 changes: 66 additions & 48 deletions _website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,73 +1,91 @@
// @ts-check

const path = require('path');

module.exports = {
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'learning-notes',
tagline: 'Notes regarding things I have learned',
url: 'https://learning-notes.mistermicheels.com',
baseUrl: '/',
onBrokenLinks: 'ignore', // broken links are checked using other scripts
onBrokenMarkdownLinks: 'ignore', // broken links are checked using other scripts
favicon: 'favicon.ico',
organizationName: 'mistermicheels',
projectName: 'learning-notes',
themeConfig: {
navbar: {
title: 'learning-notes',
logo: {
alt: 'mistermicheels logo',
src: 'img/mistermicheels.svg',
},
links: [
{
href: 'https://github.com/mistermicheels/learning-notes',
label: 'GitHub',
position: 'left',
},
{
href: 'https://twitter.com/mistermicheels',
label: 'Twitter',
position: 'left',
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: 'learning-notes',
logo: {
alt: 'mistermicheels logo',
src: 'img/mistermicheels.svg',
},
{
href: 'https://github.com/mistermicheels/learning-notes',
position: 'right',
className: 'header-github-link navbar__item navbar__link',
'aria-label': 'GitHub repository',
items: [
{
href: 'https://github.com/mistermicheels/learning-notes',
label: 'GitHub',
position: 'left',
},
{
href: 'https://twitter.com/mistermicheels',
label: 'Twitter',
position: 'left',
},
{
href: 'https://github.com/mistermicheels/learning-notes',
position: 'right',
className: 'header-github-link navbar__item navbar__link',
'aria-label': 'GitHub repository',
},
],
},
footer: {
style: 'dark',
copyright: `This work is licensed under a <a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="nofollow noopener noreferrer">Creative Commons Attribution 4.0 International
License <svg class="embedded-fa-icon"><use href="#external-link-alt"></use></svg></a>. Website built with Docusaurus.`,
},
docs: {
sidebar: {
hideable: true,
},
],
},
footer: {
style: 'dark',
copyright: `This work is licensed under a <a href="http://creativecommons.org/licenses/by/4.0/" rel="nofollow">Creative Commons Attribution 4.0 International
License</a>.`,
},
prism: {
theme: require('prism-react-renderer/themes/github'),
darkTheme: require('prism-react-renderer/themes/oceanicNext'),
},
disableDarkMode: false,
algolia: {
appId: '38H0OSE8H7',
apiKey: '1119242d2ba32e7ccfd08f8ae82b3efe',
indexName: 'mistermicheels_learning-notes',
},
},
},
prism: {
theme: require('prism-react-renderer/themes/github'),
darkTheme: require('prism-react-renderer/themes/oceanicNext'),
additionalLanguages: ["java"]
},
algolia: {
appId: '38H0OSE8H7',
apiKey: '1119242d2ba32e7ccfd08f8ae82b3efe',
indexName: 'mistermicheels_learning-notes',
},
}),

presets: [
[
'@docusaurus/preset-classic',
{
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
routeBasePath: '',
routeBasePath: '/',
},
blog: false,
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
}),
],
],
plugins: [
path.resolve(__dirname, './extended-favicon-plugin'),
path.resolve(__dirname, './embedded-font-awesome-icons-plugin'),
path.resolve(__dirname, './collapse-sidebar-again-if-js-enabled-plugin'),
path.resolve(__dirname, './goatcounter-plugin'),
],
};

module.exports = config;
Loading

0 comments on commit a4aef4d

Please sign in to comment.