-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocusaurus.config.js
169 lines (167 loc) · 5.37 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
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
166
167
168
169
// @ts-check
// `@type` JSDoc annotations allow editor autocompletion and type checking
// (when paired with `@ts-check`).
// There are various equivalent ways to declare your Docusaurus config.
// See: https://docusaurus.io/docs/api/docusaurus-config
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Hangar",
tagline: "",
favicon: "favicon.png",
url: "https://hangar.cnrancher.com",
baseUrl: "/",
// GitHub pages deployment config.
organizationName: "cnrancher",
projectName: "docs-hangar",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
onDuplicateRoutes: "warn",
i18n: {
defaultLocale: "en",
locales: [
"en",
"zh",
],
localeConfigs: {
en: {
htmlLang: "en",
label: "English",
},
zh: {
htmlLang: "zh-Hans",
label: "简体中文",
},
},
},
themeConfig: {
// image: "",
colorMode: {
defaultMode: "dark",
// Use user preference instead of default mode.
respectPrefersColorScheme: true,
// Hides the switch in the navbar.
disableSwitch: false,
},
navbar: {
hideOnScroll: false,
title: "Hangar",
// logo: {
// alt: "Hangar Logo",
// src: "",
// srcDark: "",
// },
items: [
{
type: "doc",
position: "left",
docId: "index",
label: "Documents",
},
{
href: "https://github.com/cnrancher/hangar",
label: "GitHub",
position: "left",
},
{
type: "docsVersionDropdown",
position: "left",
dropdownActiveClassDisabled: true,
dropdownItemsAfter: [
{
type: "html",
value: "<hr class='dropdown-separator'>",
},
{
to: "/versions",
label: "All Versions",
},
],
},
{
type: "localeDropdown",
position: "right",
dropdownItemsAfter: [
{
type: "html",
value: "<hr class='dropdown-separator'>",
},
{
href: "https://github.com/cnrancher/docs-hangar/tree/main/i18n/",
label: "Help Us Translate",
},
],
},
{
type: "search",
position: "right",
},
],
},
footer: {
style: "dark",
copyright: `Copyright © ${new Date().getFullYear()} SUSE Rancher. All Rights Reserved.`,
},
prism: {
additionalLanguages: [
"bash",
"shell-session",
],
},
},
presets: [
[
"@docusaurus/preset-classic",
{
docs: {
routeBasePath: "/docs",
sidebarPath: require.resolve("./sidebars.js"),
showLastUpdateTime: true,
editUrl: "https://github.com/cnrancher/docs-hangar/edit/main/",
lastVersion: "v1.8",
includeCurrentVersion: false,
versions: {
"v1.8": {
label: "v1.8",
path: "v1.8",
banner: "none",
},
"v1.7": {
label: "v1.7",
path: "v1.7",
banner: "none",
},
"v1.6": {
label: "v1.6",
path: "v1.6",
banner: "none",
},
},
},
blog: false, // disable the blog plugin
theme: {
customCss: [
require.resolve("./src/css/custom.css"),
"./src/theme/prism-dracula.css",
],
},
},
],
],
plugins: [
"plugin-image-zoom",
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
// `hashed` is recommended as long-term-cache of index file is possible.
hashed: true,
// For Docs using Chinese, The `language` is recommended to set to:
language: ["en", "zh"],
// When applying `zh` in language, please install `nodejieba` in your project.
searchResultContextMaxLength: 500,
searchResultLimits: 64,
indexPages: true
},
],
],
};
export default config;