-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocusaurus.config.js
71 lines (68 loc) · 2.11 KB
/
docusaurus.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
const { compare } = require("semver");
const path = require("path");
function getVersionFromChangelogId(id) {
const fileName = path.basename(id);
return fileName.match(/.+?(\d+\.\d+\.\d+.*)/)?.[1];
}
module.exports = {
title: "intellisense-form",
tagline: "The tagline of my site",
url: "https://sinoui.github.io",
baseUrl: "/intellisense-form-website/",
favicon: "img/favicon.ico",
organizationName: "sinoui", // Usually your GitHub org/user name.
projectName: "intellisense-form-website", // Usually your repo name.
themeConfig: {
prism: {
additionalLanguages: ["java", "http", "nginx"],
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
navbar: {
title: "智能表单",
logo: { alt: "智能表单", src: "img/home/logo.png" },
items: [{ to: "/docs", label: "文档", position: "left" }],
},
navbar: {
title: "智能表单",
logo: { alt: "智能表单", src: "img/home/logo.png" },
items: [{ to: "/docs", label: "文档", position: "left" }],
},
},
plugins: [
"./plugins/enable-wasm-plugin.js",
"./plugins/omit-license-plugin.js",
"./plugins/root-resolve-plugin.js",
],
presets: [
[
"@docusaurus/preset-classic",
{
docs: {
sidebarPath: require.resolve("./sidebars.js"),
async sidebarItemsGenerator({
defaultSidebarItemsGenerator,
...args
}) {
const sidebarItems = await defaultSidebarItemsGenerator(args);
if (sidebarItems[0]?.id?.startsWith("changelog/")) {
return sidebarItems.sort(
(item1, item2) =>
-compare(
getVersionFromChangelogId(item1.id),
getVersionFromChangelogId(item2.id)
)
);
}
return sidebarItems;
},
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
},
],
],
};