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.