Content Directory
Now, you know how to write documentation in Markdown and how to use MDC to add components to your documentation. But how to organize your documentation?
The answer is the content
directory. It's the directory where you will store all your documentation. It's the heart of your documentation.
Structure
There is not a specific structure to follow. You can organize your documentation as you want. Here is an example of a documentation structure:
content/
├── 0.index.md
├── 1.guide/
│ ├── 1.getting-started.md
│ ├── 2.configuration.md
│ ├── 3.writing.md
│ └── 4.content-directory.md
└── 2.api/
├── 1.components.md
└── 2.directives.md
But there is some interesting things to know about the content
directory.
Docus use the path and the name file to generate the path of the file.
File | Path |
---|---|
content/index.md | / |
content/about.md | /about |
content/blog/index.md | /blog |
content/blog/hello.md | /blog/hello |
content/1.guide/2.installation | /guide/installation |
As you can see, files are prefixed with a number. This is to ensure the order of the files.
Now, you know everything! You can start writing your documentation.
Filename
Please, be aware the filename is used to generate the path of the file. So, you need to be careful with the filename.
Some characters are not allowed in the filename: <>:"/\|?*
. Also, you must not use spaces in the filename.
We recommend you to use only lowercase characters and dashes (-
) to separate words. Quote ('
) must be removed and not replaced. Also, the filename must be the title of the page.
Examples:
Page title | Filename |
---|---|
Installation using WSL2 | installation-using-wsl2.md |
Useful commands for WSL2 | useful-commands-for-wsl2.md |
How to install Node.js | how-to-install-nodejs.md |