Create a Doc
To create your first documentation page in CodeHarborHub, simply add a new Markdown file inside the docs
directory.
For example, create a file called greeting.md
:
website # root directory of your site
βββ docs
β βββ greeting.md
βββ src
β βββ pages
βββ docusaurus.config.js
βββ ...
Inside greeting.md
, you can write rich Markdown content with headers, lists, and code blocks:
---
description: Create a doc page with rich content.
---
# Hello from CodeHarborHub
Welcome to your first **CodeHarborHub Doc Page**! π
## Headers
Headers automatically appear in the **table of contents (TOC)** on the right.
## Only h2 and h3 are included by default
You can configure TOC heading levels globally or per document.
- Use bullet lists to highlight key points
- Provide step-by-step instructions
- Nest lists for more structured content
β‘ Doc Front Matterβ
The front matter adds metadata to your doc. Itβs optional, but useful for features like tags or custom URLs. For all available fields, see the Docs Plugin API.
Example with tags:
---
tags:
- GettingStarted
- CodeHarborHub
---
# My First Doc
Content goes here.
You can also maintain predefined tags in a tags.yml
file:
CodeHarborHub:
label: 'CodeHarborHub'
permalink: '/codeharborhub'
description: 'Docs related to the CodeHarborHub platform'
π Organizing Folder Structureβ
Your docs folder layout affects document IDs and URLs, but you can override defaults with front matter.
Document IDβ
Each document has a unique id
, derived from its file path:
website
βββ docs
βββ greeting.md # id: greeting
βββ guide
βββ hello.md # id: guide/hello
You can override the id
in front matter:
---
id: part1
---
Content for Part 1
This id
is used when referencing docs in sidebars, links, or components.
Doc URLsβ
The default URL is based on the id
and file path:
greeting.md
β/docs/greeting
guide/hello.md
β/docs/guide/hello
Special file names like index
, README
, or a name matching its parent folder
will produce a cleaner URL without the file name.
Use the slug
front matter to override URLs:
---
slug: /bonjour
---
This doc will be served at `/docs/bonjour`
Root-Level Docsβ
To make a doc available at the site root (e.g., https://example.com/
):
---
id: home
slug: /
---
Welcome to the CodeHarborHub Documentation!
π Sidebarsβ
If you use autogenerated sidebars, your folder structure determines the sidebar hierarchy.
Recommended practice:
Mirror your folder layout to your desired sidebar structure,
and use the slug
front matter to customize URLs as needed.