|
1 | | -const lightCodeTheme = require('prism-react-renderer/themes/github'); |
2 | | -const darkCodeTheme = require('prism-react-renderer/themes/dracula'); |
| 1 | +import {themes as prismThemes} from 'prism-react-renderer'; |
| 2 | +import type {Config} from '@docusaurus/types'; |
| 3 | +import type * as Preset from '@docusaurus/preset-classic'; |
| 4 | + |
| 5 | +const config: Config = { |
| 6 | + favicon: 'img/favicon.ico', |
3 | 7 |
|
4 | | -/** @type {import('@docusaurus/types').DocusaurusConfig} */ |
5 | | -module.exports = { |
6 | 8 | title: 'Flutter WebRTC Community', |
7 | 9 | tagline: 'Make WebRTC/VoIP development easier.', |
8 | 10 | url: 'https://flutterwebrtc.com', |
| 11 | + |
| 12 | + // Set the /<baseUrl>/ pathname under which your site is served |
| 13 | + // For GitHub pages deployment, it is often '/<projectName>/' |
9 | 14 | baseUrl: '/', |
10 | | - onBrokenLinks: 'throw', |
11 | | - onBrokenMarkdownLinks: 'warn', |
12 | | - favicon: 'img/favicon.ico', |
| 15 | + |
| 16 | + // GitHub pages deployment config. |
| 17 | + // If you aren't using GitHub pages, you don't need these. |
13 | 18 | organizationName: 'flutter-webrtc', // Usually your GitHub org/user name. |
14 | 19 | projectName: 'flutter-webrtc', // Usually your repo name. |
| 20 | + |
| 21 | + onBrokenLinks: 'throw', |
| 22 | + onBrokenMarkdownLinks: 'warn', |
| 23 | + |
| 24 | + // Even if you don't use internationalization, you can use this field to set |
| 25 | + // useful metadata like html lang. For example, if your site is Chinese, you |
| 26 | + // may want to replace "en" with "zh-Hans". |
15 | 27 | i18n: { |
16 | 28 | defaultLocale: 'en', |
17 | 29 | locales: ['en', 'zh-cn'], |
18 | 30 | }, |
| 31 | + markdown: { |
| 32 | + mermaid: true, |
| 33 | + }, |
| 34 | + themes: ['@docusaurus/theme-mermaid'], |
| 35 | + presets: [ |
| 36 | + [ |
| 37 | + 'classic', |
| 38 | + { |
| 39 | + docs: { |
| 40 | + sidebarPath: require.resolve('./sidebars.js'), |
| 41 | + // Please change this to your repo. |
| 42 | + editUrl: |
| 43 | + 'https://github.com/flutter-webrtc/docs/edit/main/', |
| 44 | + }, |
| 45 | + blog: { |
| 46 | + showReadingTime: true, |
| 47 | + // Please change this to your repo. |
| 48 | + editUrl: |
| 49 | + 'https://github.com/flutter-webrtc/docs/edit/main/', |
| 50 | + }, |
| 51 | + theme: { |
| 52 | + customCss: require.resolve('./src/css/custom.css'), |
| 53 | + }, |
| 54 | + } satisfies Preset.Options, |
| 55 | + ], |
| 56 | + ], |
| 57 | + |
19 | 58 | themeConfig: { |
| 59 | + // Replace with your project's social card |
| 60 | + src: 'img/flutter-webrtc.png', |
20 | 61 | navbar: { |
21 | 62 | title: 'Flutter WebRTC Community', |
22 | 63 | logo: { |
@@ -93,30 +134,10 @@ module.exports = { |
93 | 134 | copyright: `Copyright © ${new Date().getFullYear()} Flutter-WebRTC Project.`, |
94 | 135 | }, |
95 | 136 | prism: { |
96 | | - theme: lightCodeTheme, |
97 | | - darkTheme: darkCodeTheme, |
| 137 | + theme: prismThemes.github, |
| 138 | + darkTheme: prismThemes.dracula, |
98 | 139 | }, |
99 | | - }, |
100 | | - presets: [ |
101 | | - [ |
102 | | - '@docusaurus/preset-classic', |
103 | | - { |
104 | | - docs: { |
105 | | - sidebarPath: require.resolve('./sidebars.js'), |
106 | | - // Please change this to your repo. |
107 | | - editUrl: |
108 | | - 'https://github.com/flutter-webrtc/docs/edit/main/', |
109 | | - }, |
110 | | - blog: { |
111 | | - showReadingTime: true, |
112 | | - // Please change this to your repo. |
113 | | - editUrl: |
114 | | - 'https://github.com/flutter-webrtc/docs/edit/main/', |
115 | | - }, |
116 | | - theme: { |
117 | | - customCss: require.resolve('./src/css/custom.css'), |
118 | | - }, |
119 | | - }, |
120 | | - ], |
121 | | - ], |
| 140 | + } satisfies Preset.ThemeConfig, |
122 | 141 | }; |
| 142 | + |
| 143 | +export default config; |
0 commit comments