Skip to content

Commit 60db262

Browse files
upgrqade docusaurus from v1 to v2
1 parent 59645cc commit 60db262

File tree

29 files changed

+9921
-1012
lines changed

29 files changed

+9921
-1012
lines changed

.gitignore

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
.DS_Store
1+
# dependencies
2+
/node_modules
3+
4+
# production
5+
/build
26

3-
node_modules
7+
# generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
417

5-
lib/core/metadata.js
6-
lib/core/MetadataBlog.js
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
721

8-
website/translated_docs
9-
website/build/
10-
website/yarn.lock
11-
website/node_modules
12-
website/i18n/*
22+
.vscode/*

Dockerfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

README.md

Lines changed: 13 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -1,198 +1,33 @@
1-
This website was created with [Docusaurus](https://docusaurus.io/).
1+
# Website
22

3-
# What's In This Document
3+
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
44

5-
- [Get Started in 5 Minutes](#get-started-in-5-minutes)
6-
- [Directory Structure](#directory-structure)
7-
- [Editing Content](#editing-content)
8-
- [Adding Content](#adding-content)
9-
- [Full Documentation](#full-documentation)
5+
### Installation
106

11-
# Get Started in 5 Minutes
12-
13-
1. Make sure all the dependencies for the website are installed:
14-
15-
```sh
16-
# Install dependencies
17-
$ yarn
18-
```
19-
20-
2. Run your dev server:
21-
22-
```sh
23-
# Start the site
24-
$ yarn start
25-
```
26-
27-
## Directory Structure
28-
29-
Your project file structure should look something like this
30-
31-
```
32-
my-docusaurus/
33-
docs/
34-
doc-1.md
35-
doc-2.md
36-
doc-3.md
37-
website/
38-
blog/
39-
2016-3-11-oldest-post.md
40-
2017-10-24-newest-post.md
41-
core/
42-
node_modules/
43-
pages/
44-
static/
45-
css/
46-
img/
47-
package.json
48-
sidebars.json
49-
siteConfig.js
507
```
51-
52-
# Editing Content
53-
54-
## Editing an existing docs page
55-
56-
Edit docs by navigating to `docs/` and editing the corresponding document:
57-
58-
`docs/doc-to-be-edited.md`
59-
60-
```markdown
61-
---
62-
id: page-needs-edit
63-
title: This Doc Needs To Be Edited
64-
---
65-
66-
Edit me...
67-
```
68-
69-
For more information about docs, click [here](https://docusaurus.io/docs/en/navigation)
70-
71-
## Editing an existing blog post
72-
73-
Edit blog posts by navigating to `website/blog` and editing the corresponding post:
74-
75-
`website/blog/post-to-be-edited.md`
76-
77-
```markdown
78-
---
79-
id: post-needs-edit
80-
title: This Blog Post Needs To Be Edited
81-
---
82-
83-
Edit me...
8+
$ yarn
849
```
8510

86-
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
87-
88-
# Adding Content
89-
90-
## Adding a new docs page to an existing sidebar
91-
92-
1. Create the doc as a new markdown file in `/docs`, example `docs/newly-created-doc.md`:
93-
94-
```md
95-
---
96-
id: newly-created-doc
97-
title: This Doc Needs To Be Edited
98-
---
11+
### Local Development
9912

100-
My new content here..
10113
```
102-
103-
1. Refer to that doc's ID in an existing sidebar in `website/sidebars.json`:
104-
105-
```javascript
106-
// Add newly-created-doc to the Getting Started category of docs
107-
{
108-
"docs": {
109-
"Getting Started": [
110-
"quick-start",
111-
"newly-created-doc" // new doc here
112-
],
113-
...
114-
},
115-
...
116-
}
14+
$ yarn start
11715
```
11816

119-
For more information about adding new docs, click [here](https://docusaurus.io/docs/en/navigation)
17+
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
12018

121-
## Adding a new blog post
19+
### Build
12220

123-
1. Make sure there is a header link to your blog in `website/siteConfig.js`:
124-
125-
`website/siteConfig.js`
126-
127-
```javascript
128-
headerLinks: [
129-
...
130-
{ blog: true, label: 'Blog' },
131-
...
132-
]
13321
```
134-
135-
2. Create the blog post with the format `YYYY-MM-DD-My-Blog-Post-Title.md` in `website/blog`:
136-
137-
`website/blog/2018-05-21-New-Blog-Post.md`
138-
139-
```markdown
140-
---
141-
author: Frank Li
142-
authorURL: https://twitter.com/foobarbaz
143-
authorFBID: 503283835
144-
title: New Blog Post
145-
---
146-
147-
Lorem Ipsum...
22+
$ yarn build
14823
```
14924

150-
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
15126

152-
## Adding items to your site's top navigation bar
27+
### Deployment
15328

154-
1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`:
155-
156-
`website/siteConfig.js`
157-
158-
```javascript
159-
{
160-
headerLinks: [
161-
...
162-
/* you can add docs */
163-
{ doc: 'my-examples', label: 'Examples' },
164-
/* you can add custom pages */
165-
{ page: 'help', label: 'Help' },
166-
/* you can add external links */
167-
{ href: 'https://github.com/facebook/docusaurus', label: 'GitHub' },
168-
...
169-
],
170-
...
171-
}
17229
```
173-
174-
For more information about the navigation bar, click [here](https://docusaurus.io/docs/en/navigation)
175-
176-
## Adding custom pages
177-
178-
1. Docusaurus uses React components to build pages. The components are saved as .js files in `website/pages/en`:
179-
1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element:
180-
181-
`website/siteConfig.js`
182-
183-
```javascript
184-
{
185-
headerLinks: [
186-
...
187-
{ page: 'my-new-custom-page', label: 'My New Custom Page' },
188-
...
189-
],
190-
...
191-
}
30+
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
19231
```
19332

194-
For more information about custom pages, click [here](https://docusaurus.io/docs/en/custom-pages).
195-
196-
# Full Documentation
197-
198-
Full documentation can be found on the [website](https://docusaurus.io/).
33+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

docker-compose.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/git/.gitkeep

Whitespace-only changes.

docs/java/.gitkeep

Whitespace-only changes.

docs/javascript/.gitkeep

Whitespace-only changes.

docs/python/.gitkeep

Whitespace-only changes.

docs/rest-api/.gitkeep

Whitespace-only changes.

docusaurus.config.js

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
module.exports = {
2+
title: 'Coding Standards And Convention',
3+
tagline: 'Coding Standards And Convention Documentation',
4+
url: 'https://lftechnology.com',
5+
baseUrl: '/',
6+
favicon: 'img/favicon.ico',
7+
organizationName: 'lftechnology', // Usually your GitHub org/user name.
8+
projectName: 'coding standards and convention', // Usually your repo name.
9+
themeConfig: {
10+
navbar: {
11+
title: 'Coding Standard and Convention',
12+
logo: {
13+
alt: '',
14+
src: 'img/favicon.png',
15+
},
16+
links: [
17+
{
18+
to: 'docs/',
19+
activeBasePath: 'docs',
20+
label: 'Docs',
21+
position: 'left',
22+
},
23+
{to: 'blog', label: 'Blog', position: 'left'},
24+
{
25+
href: 'https://github.com/facebook/docusaurus',
26+
label: 'GitHub',
27+
position: 'right',
28+
},
29+
],
30+
},
31+
footer: {
32+
style: 'dark',
33+
links: [
34+
{
35+
title: 'Docs',
36+
items: [
37+
{
38+
label: 'Style Guide',
39+
to: 'docs/',
40+
},
41+
{
42+
label: 'Second Doc',
43+
to: 'docs/doc2/',
44+
},
45+
],
46+
},
47+
{
48+
title: 'Community',
49+
items: [
50+
{
51+
label: 'Stack Overflow',
52+
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
53+
},
54+
{
55+
label: 'Discord',
56+
href: 'https://discordapp.com/invite/docusaurus',
57+
},
58+
{
59+
label: 'Twitter',
60+
href: 'https://twitter.com/docusaurus',
61+
},
62+
],
63+
},
64+
{
65+
title: 'More',
66+
items: [
67+
{
68+
label: 'Blog',
69+
to: 'blog',
70+
},
71+
{
72+
label: 'GitHub',
73+
href: 'https://github.com/facebook/docusaurus',
74+
},
75+
],
76+
},
77+
],
78+
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
79+
},
80+
},
81+
presets: [
82+
[
83+
'@docusaurus/preset-classic',
84+
{
85+
docs: {
86+
// It is recommended to set document id as docs home page (`docs/` path).
87+
homePageId: 'doc1',
88+
sidebarPath: require.resolve('./sidebars.js'),
89+
// Please change this to your repo.
90+
editUrl:
91+
'https://github.com/facebook/docusaurus/edit/master/website/',
92+
},
93+
blog: {
94+
showReadingTime: true,
95+
// Please change this to your repo.
96+
editUrl:
97+
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
98+
},
99+
theme: {
100+
customCss: require.resolve('./src/css/custom.css'),
101+
},
102+
},
103+
],
104+
],
105+
};

0 commit comments

Comments
 (0)