-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.ts
131 lines (118 loc) · 3.76 KB
/
docusaurus.config.ts
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
import type { Config } from "@docusaurus/types";
import type * as Preset from "@docusaurus/preset-classic";
import lightCodeTheme from "prism-react-renderer/themes/github";
import darkCodeTheme from "prism-react-renderer/themes/dracula";
const config: Config = {
title: `Op-chen'Blog`,
tagline: "Op-chen的个人主页",
url: "https://blog-jade-five-78.vercel.app",
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "/img/avator.png",
projectName: "Blog", // Usually your repo name.
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "zh",
locales: ["zh"],
},
// themes: ['@docusaurus/theme-search-algolia'],
presets: [
[
"classic",
{
docs: {
sidebarPath: require.resolve("./sidebars.js"),
remarkPlugins: [require("mdx-mermaid")],
},
blog: {
showReadingTime: true,
editUrl:
"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
},
theme: {
customCss: require.resolve("./src/css/custom.scss"),
},
} satisfies Preset.Options,
],
],
themeConfig: {
navbar: {
title: `Op-chen'Blog`,
logo: {
alt: "My Site Logo",
src: "/img/avator.png",
},
items: [
{
type: "doc",
docId: "intro",
position: "left",
label: "文章",
},
{
type: "dropdown",
label: "工具箱",
position: "left",
items: [
{
label: "时间戳工具",
to: "/tools/timestamp",
},
{
label: "Base64编解码",
to: "/tools/base64compute",
},
{
label: "三维地球",
to: "/tools/earth",
},
{
label: "Json格式",
href: "https://dbsds.github.io/json-view-web/build/",
},
],
},
{
type: "localeDropdown",
position: "right",
},
{
href: "https://github.com/DBSDs",
position: "right",
className: "header-github-link",
"aria-label": "GitHub 仓库",
},
],
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
algolia: {
// Algolia 提供的应用 ID
appId: "TS23858RNP",
// 公开 API 密钥:提交它没有危险
apiKey: "649cdab6bb34cb22dbe8e4d40d36823e",
indexName: "jade-five-78",
// 可选:见下文
contextualSearch: true,
// 可选:声明哪些域名需要用 window.location 型的导航而不是 history.push。 适用于 Algolia 配置会爬取多个文档站点,而我们想要用 window.location.href 在它们之间跳转时。
externalUrlRegex: "external\\.com|domain\\.com",
// // Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs
// replaceSearchResultPathname: {
// from: '/docs/', // or as RegExp: /\/docs\//
// to: '/',
// },
// Optional: Algolia search parameters
searchParameters: {},
// Optional: path for search page that enabled by default (`false` to disable it)
searchPagePath: "search",
//... other Algolia params
},
} satisfies Preset.ThemeConfig,
plugins: ["docusaurus-plugin-sass"],
};
export default config;