-
Notifications
You must be signed in to change notification settings - Fork 34
/
docusaurus.config.js
335 lines (325 loc) · 10.1 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const math = require('remark-math');
const katex = require('rehype-katex');
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'KCL programming language.',
tagline: 'Mutation Validation Abstraction Automation Production-Ready',
url: 'https://www.kcl-lang.io',
organizationName: 'kcl-lang', // Usually your GitHub org/user name.
projectName: 'kcl', // Usually your repo name.
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'favicon.ico',
i18n: {
defaultLocale: 'en',
locales: ['en', 'zh-CN'],
localeConfigs: {
en: {
label: 'English',
},
"zh-CN": {
label: '简体中文',
},
},
},
scripts: [],
customFields: {
tagDescription: 'KCL is an open-source constraint-based record & functional programming language mainly used in configuration and policy scenarios.',
hero: {
description: "KCL is an open-source constraint-based record & functional programming language mainly used in configuration and policy scenarios.",
buttons: {
first: {
url: "docs/user_docs/intro/kcl-intro",
text: "Learn More",
},
second: {
url: "docs/user_docs/getting-started/",
text: "Getting Started",
},
},
},
sections: {
features: {
title: "Why KCL?",
featureList: [
{
title: 'Easy-to-Use',
imageUrl: 'img/microsite/reasons/extensible.svg',
description: `
Originated from programming languages such as Python and Golang, rich language features, power IDEs and tools.
`,
},
{
title: 'Quick Modeling',
imageUrl: 'img/microsite/reasons/single-entrypoint.svg',
description: `
Schema-centric configuration types and modular abstraction.
Configuration with type, logic and policy based on Config, Schema, Lambda, Rule.
`,
},
{
title: 'Stability',
imageUrl: 'img/microsite/reasons/extensible.svg',
description: `
Configuration stability built on static type system, constraints, and rules.
`,
},
{
title: 'Scalability',
imageUrl: 'img/microsite/reasons/single-entrypoint.svg',
description: `
High scalability through automatic merge mechanism of isolated config blocks.
`,
},
{
title: 'Fast Automation',
imageUrl: 'img/microsite/reasons/user-experience.svg',
description: `
High compile time and runtime performance.
Gradient automation scheme of CRUD APIs, multilingual SDKs, language plugins for GitOps.
`,
},
{
title: 'API Affinity',
imageUrl: 'img/microsite/reasons/file.svg',
description: `
Native support API ecological specifications such as OpenAPI, Kubernetes CRD and KRM spec.
`,
},
],
},
consolidation: {
snippets: [
`
Stop putting your team through an endless stream of high-friction tools and user interfaces.
Clutch allows you to combine many tools into one, in the form that your developers use most.
`,
`
We grow with you. Clutches extensible platform means you can integrate as many tools as
you need, even if they are specific to you.
`,
]
}
},
},
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
// default version: Next
// lastVersion: 'current',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/kcl-lang/kcl-lang.io/tree/main',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
remarkPlugins: [math],
rehypePlugins: [katex],
},
blog: {
blogSidebarCount: "ALL",
postsPerPage: 2,
showReadingTime: true,
editUrl: 'https://github.com/kcl-lang/kcl-lang.io/tree/main',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],
stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
type: 'text/css',
integrity:
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
crossorigin: 'anonymous',
},
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// hideableSidebar: true,
announcementBar: {
id: 'announcementBar-1', // Increment on change
content: `Give us a star ⭐️ - If you are using KCL or think it is an interesting project, we would love a star and record on <a target="_blank" rel="noopener noreferrer" href="https://github.com/kcl-lang/kcl">Github</a> and <a target="_blank" rel="noopener noreferrer" href="https://github.com/kcl-lang/kcl/issues/578">Record Issue</a>`,
},
navbar: {
title: 'KCL',
logo: {
alt: 'KCL Logo',
src: 'img/kcl-logo.png',
},
items: [
{
type: 'docSidebar',
docId: 'intro/kcl-intro',
position: 'left',
sidebarId: 'user_docs',
label: 'UserDoc',
},
{
type: 'docSidebar',
position: 'left',
sidebarId: 'reference',
label: 'Reference',
},
{
type: 'docSidebar',
position: 'left',
sidebarId: 'tools',
label: 'Tools',
},
{
href: 'https://artifacthub.io/packages/search?org=kcl&sort=relevance&page=1',
position: 'left',
sidebarId: 'modules',
label: 'Modules',
},
{
href: 'http://play.kcl-lang.io/',
// href: "http://101.42.3.224/",
position: 'left',
sidebarId: 'playground',
label: 'Playground',
},
{
href: 'https://github.com/kcl-lang/examples',
position: 'left',
sidebarId: 'examples',
label: 'Examples',
},
{
type: 'docSidebar',
position: 'left',
sidebarId: 'community',
label: 'Community',
},
{ to: '/blog', label: 'Blog', position: 'left' },
{
type: 'docsVersionDropdown',
position: 'right',
dropdownActiveClassDisabled: true
},
{
type: 'localeDropdown',
position: 'right',
dropdownItemsAfter: [
{
href: 'https://github.com/kcl-lang/kcl-lang.io/issues/',
label: 'Help Us Translate',
},
],
},
{
href: 'https://github.com/kcl-lang/kcl',
className: 'header-github-link',
'aria-label': 'GitHub repository',
position: 'right',
},
].filter(item => true),
},
footer: {
links: [
{
title: 'Document',
items: [
{
label: 'Introduction',
to: '/docs/user_docs/getting-started/intro',
},
{
label: 'Guides',
to: '/docs/user_docs/guides',
},
{
label: 'Tutorial',
to: '/docs/reference/lang/tour',
},
{
label: 'FAQ',
to: '/docs/user_docs/support',
},
],
},
{
title: 'Resource',
items: [
{
label: 'Github',
href: 'https://github.com/kcl-lang/kcl',
},
{
label: 'Blog',
to: '/blog',
},
{
label: 'Community',
href: '/docs/community/intro',
},
],
},
{
title: 'More',
items: [
{
label: 'KusionStack',
href: 'https://kusionstack.io',
},
],
},
],
copyright: `
<br />
<br />
<strong>© KCL Authors ${new Date().getFullYear()} | Documentation Distributed under <a href="https://creativecommons.org/licenses/by/4.0">CC-BY-4.0</a> </strong>
<br />
<br />
© ${new Date().getFullYear()} The Linux Foundation. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our <a href="https://www.linuxfoundation.org/trademark-usage/"> Trademark Usage</a> page.
`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
docs: {
sidebar: {
autoCollapseCategories: true
}
}
}),
plugins: [
[
'@docusaurus/plugin-google-gtag',
{
trackingID: 'G-MZD1X1PB2Q',
anonymizeIP: true,
},
],
[
require.resolve("@cmfcmf/docusaurus-search-local"),
{
language: ["en", "zh"],
},
],
async function myPlugin(context, options) {
return {
name: "docusaurus-tailwindcss",
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(require("tailwindcss"));
postcssOptions.plugins.push(require("autoprefixer"));
return postcssOptions;
},
};
},
],
};
module.exports = config;