Skip to main content

Add New Doc

This page shows you how to add a new documentation page to Nocturne.

Estimated time: 2 minutes.


Step 1 — Create the Markdown File​

Create a new .md file in docs/.

Example: docs/getting-started/deployment.md

---
sidebar_position: 5
sidebar_label: Deployment
title: "Deployment — Publish Your Nocturne Site"
description: "Deploy your Nocturne documentation to production."
---

# Deployment

Content goes here.

Step 2 — Add Frontmatter​

Every doc needs frontmatter at the top:

FieldRequiredPurpose
sidebar_positionNoNumber — order within a category
sidebar_labelNoShort name in the sidebar
titleYesPage title (browser tab + h1)
descriptionNoMeta description for SEO

Note: If you use a manual sidebars.ts, sidebar_position is ignored — the order in sidebars.ts wins.


Step 3 — Add to sidebars.ts​

Open sidebars.ts. Add the doc ID to the correct category.

Doc ID = file path without .md.

Example: docs/getting-started/deployment.md → getting-started/deployment

{
type: 'category',
label: 'Getting Started',
items: [
'getting-started/index',
'getting-started/installation',
'getting-started/local-setup',
'getting-started/cloud-setup',
'getting-started/deployment', // ← new
],
}

Step 4 — Save and Verify​

  1. Save the file
  2. The dev server reloads automatically
  3. Open http://localhost:3000/docs/getting-started/deployment

The page should appear in the sidebar.


Adding Images​

Place images in static/img/. Reference them with /img/:

![Alt text](/img/my-screenshot.webp)

Adding Code Blocks​

Use triple backticks with a language:

```bash
npm install
```

Supported languages in Nocturne:

  • python, bash, yaml, markdown, json
  • typescript, jsx, tsx
  • sql, go, rust

Adding a Table​

| Column A | Column B |
|---|---|
| Value 1 | Value 2 |

Adding Admonitions​

Docusaurus supports admonitions:

:::note
This is a note.
:::

:::tip
This is a tip.
:::

:::warning
This is a warning.
:::

:::danger
This is a danger.
:::

Link to other docs using absolute paths:

See [Installation](/docs/getting-started/installation).

Standard Markdown:

[Visit Nocturne](https://nocturne.axcora.com)

Common Patterns​

Overview Page​

---
sidebar_position: 1
sidebar_label: Overview
title: "Section — Overview"
description: "Overview of this section."
---

# Section

Brief intro.

## What You'll Learn

- Item 1
- Item 2

## What's Next?

👉 [Next: First Doc →](/docs/section/first-doc)

Step-by-Step Guide​

## Step 1 — Do This

Explanation.

```bash
command
```

## Step 2 — Do That

Explanation.

Reference Page​

## Field Name

| Field | Type | Description |
|---|---|---|
| `name` | string | The name |

Adding to Decap CMS​

Decap CMS can edit docs. But you must add the doc to sidebars.ts manually.

Decap CMS can:

  • Edit existing docs
  • Create new doc files
  • Set frontmatter

Decap CMS cannot:

  • Add the doc to sidebars.ts
  • Create new categories

See Decap CMS → Adding a New Category for details.


Troubleshooting​

Doc doesn't appear in the sidebar​

  1. Check the doc ID in sidebars.ts matches the file path
  2. Check that the file has .md extension
  3. Restart the dev server

"These sidebar document ids do not exist"​

A doc ID in sidebars.ts doesn't match a file. Check spelling and folder structure.

Frontmatter error​

  1. Check that frontmatter starts and ends with ---
  2. Check YAML syntax — no tabs, use spaces
  3. Check that strings with special characters are quoted

Image doesn't load​

  1. Check that the file exists in static/img/
  2. Check that the path starts with /img/
  3. Check the file extension

What's Next?​

Now let's add a new category.

👉 Next: Add New Category →