-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocusaurus.config.ts
More file actions
165 lines (149 loc) · 3.78 KB
/
Copy pathdocusaurus.config.ts
File metadata and controls
165 lines (149 loc) · 3.78 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
const base_dir = "notes/";
const dirs = [
"docker",
"linux",
"mac",
"others",
"windows",
"github",
];
const plugins = [
require.resolve('docusaurus-lunr-search'),
[
"@docusaurus/plugin-content-docs",
{
id: "python",
path: "notes/python",
routeBasePath: "notes/python",
sidebarPath: "./sidebars.ts",
},
],
];
for (const d of dirs) {
plugins.push([
"@docusaurus/plugin-content-docs",
{
id: d,
path: base_dir + d,
routeBasePath: base_dir + d,
sidebarPath: "./sidebars.ts",
},
]);
}
const config: Config = {
title: "hjkl01's Notes",
tagline: "个人笔记 & 工具集",
url: "https://hjkl01.github.io",
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
favicon: "img/favicon-16x16.png",
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "hjkl01", // Usually your GitHub org/user name.
projectName: "hjkl01.github.io", // Usually your repo name.
deploymentBranch: "gh-pages",
trailingSlash: false,
i18n: {
defaultLocale: 'zh',
locales: ['zh'],
},
plugins: plugins,
presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/hjkl01/hjkl01.github.io/tree/master/',
},
theme: {
customCss: [
'./src/css/custom.css',
'./src/css/tailwind.css'
],
},
} satisfies Preset.Options,
],
],
themeConfig: {
docs: {
sidebar: {
hideable: true,
autoCollapseCategories: true,
},
},
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'My Site',
logo: {
alt: 'My Site Logo',
src: "img/apple-touch-icon.png",
},
hideOnScroll: false,
items: [
{ to: "nav/", label: "Nav", position: "left" },
{ to: "rss/", label: "RSS", position: "left" },
{
type: "dropdown",
label: "Notes",
position: "left",
items: [
{ to: "/notes/python", label: "Python" },
{ to: "/notes/linux", label: "Linux" },
{ to: "/notes/docker", label: "Docker" },
],
},
{
type: "dropdown",
label: "Others",
position: "left",
items: [
{ to: "/notes/mac", label: "Mac" },
{ to: "/notes/windows", label: "Windows" },
{ to: "/notes/others", label: "Others" },
],
},
{
type: "dropdown",
label: "Tools",
position: "left",
items: [
{ to: "calculator/", label: "Calculator" },
{ to: "regex/", label: "regex" },
],
},
{ to: "notes/github", label: "Github Trending", position: "left" },
{
type: 'search',
position: 'right',
},
{
href: "https://github.com/hjkl01/hjkl01.github.io",
label: "GitHub",
position: "right",
},
],
},
footer: {
style: 'dark',
links: [
],
copyright: `Copyright © ${new Date().getFullYear()} hjkl01. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
defaultLanguage: 'python',
// defaultLanguage: 'javascript',
},
} satisfies Preset.ThemeConfig,
};
export default config;