Skip to main content

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:

docs/greeting.md
---
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:

docs/my-doc.md
---
tags:
- GettingStarted
- CodeHarborHub
---

# My First Doc
Content goes here.

You can also maintain predefined tags in a tags.yml file:

docs/tags.yml
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:

docs/guide/hello.md
---
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!

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.