Skip to content

Commit 1cbfe36

Browse files
committed
Add guides for common actions
1 parent 64b0506 commit 1cbfe36

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,73 @@ This command generates static content into the `build` directory and can be serv
3737

3838
Learn how to contribute to this website.
3939

40+
### Configs
41+
42+
All the configs can be found in `docusaurus.config.js`.
43+
44+
### Create a doc page
45+
46+
Create a Markdown file, `example.md`, and place it under the `docs` directory. Any markdown file will render into the site without needing any extra configuration. It will be displayed alphabetically on the sidebar.
47+
48+
```bash
49+
/root # root directory
50+
├── docs
51+
│ └── example.md
52+
├── docusaurus.config.js
53+
├── ...
54+
```
55+
56+
Markdown documents can use the Markdown front matter metadata fields, enclosed by a line `---` on either side. At the top of the file, you can optionally specify attributes in the front matter, so that Docusaurus will pick them up correctly when generating the site. Accepted fields can be found [here](https://docusaurus.io/docs/next/api/plugins/@docusaurus/plugin-content-docs#markdown-front-matter).
57+
58+
### Create a doc category
59+
60+
Creating a `example.md` in a sub folder will create a category in the sidebar.
61+
62+
```bash
63+
/root # root directory
64+
├── docs
65+
│ ├── sub-folder
66+
│ └── example.md
67+
```
68+
69+
To change the category name or other category meta data, an optional file `_category_.json` can be created in the respective sub folder.
70+
71+
```json
72+
{
73+
"label": "Tutorial"
74+
}
75+
```
76+
77+
### Static Assets
78+
79+
The Static Assets can be found in the `static` folder. More [here](https://docusaurus.io/docs/next/static-assets).
80+
81+
### Change theme color
82+
83+
Generate the variables from [here](https://docusaurus.io/docs/next/styling-layout#styling-your-site-with-infima). Then replace the variables in `src/css/custom.css` with these new variables. Don't forget variables for dark mode.
84+
85+
### Change codeBlock theme
86+
87+
Docusaurus uses [Prism React Renderer](https://github.com/FormidableLabs/prism-react-renderer) to highlight code blocks. All configuration are in the `prism` object of `docusaurus.config.js`. You can specify a custom theme from the [list of available themes](https://github.com/FormidableLabs/prism-react-renderer/tree/master/src/themes).
88+
89+
### Change footer
90+
91+
You can add logo and a copyright to the footer via `themeConfig.footer`. More [here](https://docusaurus.io/docs/next/api/themes/configuration#footer-1).
92+
93+
### Blog
94+
95+
To set up blog, start by creating a `blog` directory. More [here](https://docusaurus.io/docs/next/blog).
96+
97+
### Admonitions
98+
99+
In addition to the basic Markdown syntax, Docusaurus use [remark-admonitions](https://github.com/elviswolcott/remark-admonitions) alongside MDX to add support for admonitions. Admonitions are wrapped by a set of 3 colons. More [here](https://docusaurus.io/docs/next/markdown-features/admonitions).
100+
101+
### Update Docusaurus version
102+
103+
To update Docusaurus version, manually change the version number in `package.json` to the desired version. Then run `npm run install`.
104+
105+
Any required change/depricated message will be shown on the terminal when running the command `npm run start`. More [here](https://docusaurus.io/docs/next/installation#updating-your-docusaurus-version).
106+
40107
## Status
41108

42109
The current status of the website is **under construction**. Please follow us on Twitter [@chkware](https://twitter.com/chkware) for update. Thank you for your patience.

0 commit comments

Comments
 (0)