Skip to content

Commit 3155a8a

Browse files
authored
feat: add docusaurus (#36)
* feat: add docusaurus
1 parent 3fb225a commit 3155a8a

33 files changed

+785
-14
lines changed

.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,26 @@
33

44
# Jetbrains
55
.idea
6+
7+
8+
# Dependencies
9+
/node_modules
10+
11+
# Production
12+
/build
13+
14+
# Generated files
15+
.docusaurus
16+
.cache-loader
17+
18+
# Misc
19+
.env.local
20+
.env.development.local
21+
.env.test.local
22+
.env.production.local
23+
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
package-lock.json

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

docusaurus.config.js

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
// @ts-check
2+
// Note: type annotations allow type checking and IDEs autocompletion
3+
4+
const lightCodeTheme = require('prism-react-renderer/themes/github');
5+
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
6+
7+
/** @type {import('@docusaurus/types').Config} */
8+
const config = {
9+
title: 'Vanus Docs',
10+
tagline: 'How to use Vanus',
11+
url: 'https://docs.linkall.com',
12+
baseUrl: '/',
13+
onBrokenLinks: 'throw',
14+
onBrokenMarkdownLinks: 'warn',
15+
favicon: 'img/favicon.ico',
16+
// GitHub pages deployment config.
17+
// If you aren't using GitHub pages, you don't need these.
18+
organizationName: 'linkall-labs', // Usually your GitHub org/user name.
19+
projectName: 'vanus', // Usually your repo name.
20+
21+
// Even if you don't use internalization, you can use this field to set useful
22+
// metadata like html lang. For example, if your site is Chinese, you may want
23+
// to replace "en" with "zh-Hans".
24+
i18n: {
25+
defaultLocale: 'en',
26+
locales: ['en'],
27+
},
28+
29+
presets: [
30+
[
31+
'classic',
32+
/** @type {import('@docusaurus/preset-classic').Options} */
33+
({
34+
docs: {
35+
routeBasePath: "/",
36+
path: "user-manual",
37+
showLastUpdateTime: true,
38+
sidebarPath: require.resolve('./sidebars.js'),
39+
// Please change this to your repo.
40+
// Remove this to remove the "edit this page" links.
41+
editUrl: 'https://github.com/linkall-labs/docs/edit/main',
42+
},
43+
blog: {
44+
showReadingTime: true,
45+
// Please change this to your repo.
46+
// Remove this to remove the "edit this page" links.
47+
editUrl: 'https://github.com/linkall-labs/docs/edit/main',
48+
},
49+
theme: {
50+
customCss: require.resolve('./src/css/custom.css'),
51+
},
52+
}),
53+
],
54+
],
55+
// themes: ['@docusaurus/theme-search-algolia'],
56+
themeConfig:
57+
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
58+
({
59+
algolia: {
60+
id: '111',
61+
appId: 'NL3TWIITE6',
62+
apiKey: 'fa8450ef71ea4c0887cf399af0d4eef0',
63+
indexName: 'vanus-docs',
64+
contextualSearch: true,
65+
},
66+
navbar: {
67+
title: 'Vanus',
68+
logo: {
69+
alt: 'vanus log',
70+
src: 'img/logo.svg',
71+
},
72+
items: [
73+
{
74+
type: 'doc',
75+
docId: 'introduction',
76+
position: 'left',
77+
label: 'Docs',
78+
},
79+
// {to: '/blog', label: 'Blog', position: 'left'},
80+
{
81+
href: 'https://github.com/linkall-labs/vanus',
82+
label: 'GitHub',
83+
position: 'right',
84+
},
85+
],
86+
},
87+
footer: {
88+
style: 'dark',
89+
links: [
90+
// {
91+
// title: 'Docs',
92+
// items: [
93+
// {
94+
// label: 'Tutorial',
95+
// to: '/docs/intro',
96+
// },
97+
// ],
98+
// },
99+
// {
100+
// title: 'Community',
101+
// items: [
102+
// {
103+
// label: 'Stack Overflow',
104+
// href: 'https://stackoverflow.com/questions/tagged/docusaurus',
105+
// },
106+
// {
107+
// label: 'Discord',
108+
// href: 'https://discordapp.com/invite/docusaurus',
109+
// },
110+
// {
111+
// label: 'Twitter',
112+
// href: 'https://twitter.com/docusaurus',
113+
// },
114+
// ],
115+
// },
116+
{
117+
title: 'More',
118+
items: [
119+
// {
120+
// label: 'Blog',
121+
// to: '/blog',
122+
// },
123+
{
124+
label: 'GitHub',
125+
href: 'https://github.com/linkall-labs/vanus',
126+
},
127+
],
128+
},
129+
],
130+
copyright: `Copyright © ${new Date().getFullYear()} Linkall Inc. Built with Docusaurus.`,
131+
},
132+
prism: {
133+
theme: lightCodeTheme,
134+
darkTheme: darkCodeTheme,
135+
},
136+
}),
137+
};
138+
139+
module.exports = config;

package.json

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "website",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"docusaurus": "docusaurus",
7+
"start": "docusaurus start",
8+
"build": "docusaurus build",
9+
"swizzle": "docusaurus swizzle",
10+
"deploy": "docusaurus deploy",
11+
"clear": "docusaurus clear",
12+
"serve": "docusaurus serve",
13+
"write-translations": "docusaurus write-translations",
14+
"write-heading-ids": "docusaurus write-heading-ids"
15+
},
16+
"dependencies": {
17+
"@docusaurus/core": "2.1.0",
18+
"@docusaurus/preset-classic": "2.1.0",
19+
"@mdx-js/react": "^1.6.22",
20+
"clsx": "^1.2.1",
21+
"prism-react-renderer": "^1.3.5",
22+
"react": "^17.0.2",
23+
"react-dom": "^17.0.2"
24+
},
25+
"devDependencies": {
26+
"@docusaurus/module-type-aliases": "2.1.0"
27+
},
28+
"browserslist": {
29+
"production": [
30+
">0.5%",
31+
"not dead",
32+
"not op_mini all"
33+
],
34+
"development": [
35+
"last 1 chrome version",
36+
"last 1 firefox version",
37+
"last 1 safari version"
38+
]
39+
},
40+
"engines": {
41+
"node": ">=16.14"
42+
}
43+
}

sidebars.js

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/**
2+
* Creating a sidebar enables you to:
3+
- create an ordered group of docs
4+
- render a sidebar for each doc of that group
5+
- provide next/previous navigation
6+
7+
The sidebars can be generated from the filesystem, or explicitly defined here.
8+
9+
Create as many sidebars as you want.
10+
*/
11+
12+
// @ts-check
13+
14+
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
15+
const sidebars = {
16+
introSidebar: [
17+
{
18+
type: 'category',
19+
label: 'Introduction',
20+
link: {
21+
type: 'doc',
22+
id: 'introduction',
23+
},
24+
items: ['introduction/features', 'introduction/roadmap'],
25+
},
26+
{
27+
type: 'category',
28+
label: 'Getting Started',
29+
link: {
30+
type: 'doc',
31+
id: 'concepts',
32+
},
33+
items: ['getting-started/playground', 'getting-started/install'],
34+
},
35+
{
36+
type: 'category',
37+
label: 'Concepts',
38+
link: {
39+
type: 'doc',
40+
id: 'concepts',
41+
},
42+
items: ['concepts/architecture', 'concepts/cloudevents', 'concepts/eventbus',
43+
'concepts/subscription', 'concepts/dead-letter', 'concepts/connector'],
44+
},
45+
{
46+
type: 'category',
47+
label: 'How to',
48+
link: {
49+
type: 'doc',
50+
id: 'how-to',
51+
},
52+
items: [
53+
{
54+
type: 'category',
55+
label: 'Producing',
56+
items: ['how-to/producing-event/using-sdk', 'how-to/producing-event/send-delay-event'],
57+
},
58+
{
59+
type: 'category',
60+
label: 'Consuming',
61+
items: ['how-to/consuming-event/using-sdk'],
62+
},
63+
'how-to/managing-eventbus',
64+
'how-to/managing-subscription',
65+
'how-to/managing-dlq',
66+
'how-to/vsctl',
67+
],
68+
},
69+
{
70+
type: 'category',
71+
label: 'Connectors',
72+
link: {
73+
type: 'doc',
74+
id: 'connectors',
75+
},
76+
items: [
77+
{
78+
type: 'category',
79+
label: 'Source',
80+
link: {
81+
type: 'doc',
82+
id: 'connectors/source',
83+
},
84+
items: [
85+
'connectors/source/mysql'
86+
],
87+
},
88+
{
89+
type: 'category',
90+
label: 'Sink',
91+
link: {
92+
type: 'doc',
93+
id: 'connectors/sink',
94+
},
95+
items: [
96+
'connectors/sink/mysql'
97+
],
98+
},
99+
],
100+
},
101+
],
102+
};
103+
104+
module.exports = sidebars;

src/css/custom.css

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Any CSS included here will be global. The classic template
3+
* bundles Infima by default. Infima is a CSS framework designed to
4+
* work well for content-centric websites.
5+
*/
6+
7+
/* You can override the default Infima variables here. */
8+
:root {
9+
--ifm-color-primary: #2e8555;
10+
--ifm-color-primary-dark: #29784c;
11+
--ifm-color-primary-darker: #277148;
12+
--ifm-color-primary-darkest: #205d3b;
13+
--ifm-color-primary-light: #33925d;
14+
--ifm-color-primary-lighter: #359962;
15+
--ifm-color-primary-lightest: #3cad6e;
16+
--ifm-code-font-size: 95%;
17+
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
18+
}
19+
20+
/* For readability concerns, you should choose a lighter palette in dark mode. */
21+
[data-theme='dark'] {
22+
--ifm-color-primary: #25c2a0;
23+
--ifm-color-primary-dark: #21af90;
24+
--ifm-color-primary-darker: #1fa588;
25+
--ifm-color-primary-darkest: #1a8870;
26+
--ifm-color-primary-light: #29d5b0;
27+
--ifm-color-primary-lighter: #32d8b4;
28+
--ifm-color-primary-lightest: #4fddbf;
29+
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
30+
}

static/.nojekyll

Whitespace-only changes.

static/img/docusaurus.png

5.02 KB
Loading

static/img/favicon.ico

3.54 KB
Binary file not shown.

static/img/logo.svg

+1
Loading

0 commit comments

Comments
 (0)