diff --git a/docusaurus.config.js b/docusaurus.config.js index 547920f..24664e7 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -1,13 +1,7 @@ -// @ts-check -// Note: type annotations allow type checking and IDEs autocompletion +import { themes as prismThemes } from 'prism-react-renderer'; -const { themes } = require('prism-react-renderer'); -const lightCodeTheme = themes.github; -const darkCodeTheme = themes.dracula; - -/** @type {import('@docusaurus/types').Config} */ -const config = { +export default { title: 'Edwardzjl', tagline: '温故而知新', url: 'https://edwardzjl.github.io', @@ -32,11 +26,18 @@ const config = { locales: ['en', 'zh-Hans'], }, + markdown: { + mdx1Compat: { + comments: false, + admonitions: false, + headingIds: true, + }, + }, + presets: [ [ 'classic', - /** @type {import('@docusaurus/preset-classic').Options} */ - ({ + { docs: { sidebarPath: require.resolve('./sidebars.js'), // Please change this to your repo. @@ -54,85 +55,54 @@ const config = { theme: { customCss: require.resolve('./src/css/custom.css'), }, - }), + }, ], ], - themeConfig: - /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ - ({ - navbar: { - title: 'My Site', - logo: { - alt: 'My Site Logo', - src: 'img/logo.svg', - }, - items: [ - // { - // type: 'doc', - // docId: 'intro', - // position: 'left', - // label: 'Tutorial', - // }, - { to: '/blog', label: 'Blog', position: 'left' }, - { - href: 'https://github.com/edwardzjl/edwardzjl.github.io', - label: 'GitHub', - position: 'right', - }, - ], - }, - footer: { - style: 'dark', - links: [ - // { - // title: 'Docs', - // items: [ - // { - // label: 'Tutorial', - // to: '/docs/intro', - // }, - // ], - // }, - // { - // title: 'Community', - // items: [ - // { - // label: 'Stack Overflow', - // href: 'https://stackoverflow.com/questions/tagged/docusaurus', - // }, - // { - // label: 'Discord', - // href: 'https://discordapp.com/invite/docusaurus', - // }, - // { - // label: 'Twitter', - // href: 'https://twitter.com/docusaurus', - // }, - // ], - // }, - { - title: 'More', - items: [ - { - label: 'Blog', - to: '/blog', - }, - { - label: 'GitHub', - href: 'https://github.com/edwardzjl/edwardzjl.github.io', - }, - ], - }, - ], - copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, + themeConfig: { + navbar: { + title: 'My Site', + logo: { + alt: 'My Site Logo', + src: 'img/logo.svg', }, - prism: { - theme: lightCodeTheme, - darkTheme: darkCodeTheme, - additionalLanguages: ['bash', 'diff', 'json'], - }, - }), + items: [ + // { + // type: 'doc', + // docId: 'intro', + // position: 'left', + // label: 'Tutorial', + // }, + { to: '/blog', label: 'Blog', position: 'left' }, + { + href: 'https://github.com/edwardzjl/edwardzjl.github.io', + label: 'GitHub', + position: 'right', + }, + ], + }, + footer: { + style: 'dark', + links: [ + { + title: 'More', + items: [ + { + label: 'Blog', + to: '/blog', + }, + { + label: 'GitHub', + href: 'https://github.com/edwardzjl/edwardzjl.github.io', + }, + ], + }, + ], + copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, + }, + prism: { + theme: prismThemes.github, + darkTheme: prismThemes.dracula, + }, + }, }; - -module.exports = config;