-
Notifications
You must be signed in to change notification settings - Fork 27
/
docusaurus.config.js
213 lines (211 loc) · 5.66 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
const lightCodeTheme = require('prism-react-renderer/themes/github')
const darkCodeTheme = require('prism-react-renderer/themes/dracula')
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
title: 'Nocalhost',
tagline:
'Nocalhost is an open-source toolsets help to build cloud-native applications easier and faster',
url: 'https://nocalhost.dev/',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'nocalhost', // Usually your GitHub org/user name.
projectName: 'nocalhost.github.io', // Usually your repo name.
// i18n Configurations
i18n: {
defaultLocale: 'en',
locales: ['en', 'zh-CN'],
localeConfigs: {
en: {
label: 'English',
},
'zh-CN': {
label: '中文(中国)',
},
},
},
// Stylesheets
stylesheets: ['https://fonts.googleapis.com/icon?family=Material+Icons'],
// Plugins
plugins: [
[
// PWA
'@docusaurus/plugin-pwa',
{
debug: true,
offlineModeActivationStrategies: [
'appInstalled',
'standalone',
'queryString',
],
pwaHead: [
{
tagName: 'link',
rel: 'icon',
href: '/img/favicon.ico',
},
{
tagName: 'link',
rel: 'manifest',
href: '/manifest.json', // PWA manifest
},
{
tagName: 'meta',
name: 'theme-color',
content: 'rgb(37, 194, 160)',
},
],
},
],
// Custom Redirect
// Image Zoom
'plugin-image-zoom',
'docusaurus-plugin-sass',
],
themeConfig: {
// Search
algolia: {
apiKey: 'a20f9e4540c8e520a806eae92c33cdd5',
indexName: 'nocalhost',
},
// Navbar
navbar: {
title: 'Nocalhost',
logo: {
alt: 'Most productive cloud-native development toolsets',
src: 'img/logo.png',
},
items: [
// Documentations
{
type: 'doc',
docId: 'introduction',
position: 'left',
label: 'Docs',
},
// Video
{ to: '/videos', label: 'Videos', position: 'left' },
// Tools
{ to: '/tools', label: 'Tools', position: 'left' },
// Blog
{ to: '/blog', label: 'Blog', position: 'left' },
// Version
// {
// type: 'docsVersionDropdown',
// position: 'right',
// dropdownItemsAfter: [{to: '/versions', label: 'All Versions'}],
// },
// Language
{
type: 'localeDropdown',
position: 'right',
},
// Github Icon
{
href: 'https://github.com/nocalhost/nocalhost',
// label: 'GitHub',
position: 'right',
className: 'header-github-link',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Quickstart',
to: '/docs/quick-start',
},
{
label: 'GitHub Repository',
to: 'https://github.com/nocalhost/nocalhost',
},
{
label: 'Documentation',
to: '/docs/introduction',
},
],
},
{
title: 'Community',
items: [
{
label: 'Slack',
href: 'https://nocalhost.slack.com/',
},
{
label: 'Twitter',
href: 'https://twitter.com/nocalhost',
},
{
label: 'Linkedin',
href: 'https://www.linkedin.com/in/nocalhost/',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Nocalhost | Initiated by <a href="https://coding.net/" target="_blank">Coding.net</a>`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
// Announcement
announcementBar: {
id: 'announcementBar-1', // Increment on change
content:
'⭐️ If you like Nocalhost, give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/nocalhost/nocalhost">GitHub</a>! ⭐',
},
},
presets: [
[
'@docusaurus/preset-classic',
{
// Docs
docs: {
path: 'docs',
sidebarPath: 'sidebars.js',
editUrl: ({ locale, docPath }) => {
if (locale !== 'en') {
return `https://crowdin.com/project/nocalhost/${locale}`
}
const nextVersionDocsDirPath = 'docs'
return `https://github.com/nocalhost/nocalhost.github.io/tree/main/${nextVersionDocsDirPath}/${docPath}`
},
// editUrl: 'https://github.com/nocalhost/nocalhost.github.io/tree/main',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
},
// Blog
blog: {
showReadingTime: true,
blogSidebarCount: 'ALL',
blogSidebarTitle: 'All our posts',
editUrl: ({ locale, blogDirPath, blogPath }) => {
if (locale !== 'en') {
return `https://crowdin.com/project/nocalhost/${locale}`
}
return `https://github.com/nocalhost/nocalhost.github.io/tree/main/${blogDirPath}/${blogPath}`
},
},
// Theme
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
}