Skip to content
GardenCMS

Docs › Markdown

Markdown

Markdown documents are for content that reads best as prose — documentation, guides, a changelog. These docs are markdown.

Where documents live

Documents are stored by the same storage backend as your media, under an md/ folder:

  • Local disk — data/media/md/… (or wherever MEDIA_ROOT points)
  • S3 — md/… in your bucket, after any key prefix

Because they live in storage rather than on the app's disk, documents survive redeploys — including on serverless hosts whose disk is thrown away.

Editing

Go to Markdown in the admin:

  • New document — enter a path like docs/getting-started.md and write it in the editor, with a live preview in your active theme
  • Upload — pick one or more .md files and the directory to put them in
  • Edit / delete — click any document in the list

Paths are lowercase letters, numbers, ., _ and -, at least one directory deep.

Mounting a directory at a URL

Each top-level directory can be served under a URL prefix. With docs mounted at docs:

Document URL
docs/index.md /docs
docs/getting-started.md /docs/getting-started
docs/styling/css.md /docs/styling/css

Set or change prefixes in the table at the bottom of the Markdown page; leave one blank to stop serving that directory. Mounted directories also appear in the site navigation.

A CMS page with the same slug wins over a markdown route.

Titles

A document's title is its first # heading. Without one, the file name is used — getting-started.md becomes "Getting Started".

Layouts

A _layout.jinja file wraps the documents in its directory (the nearest one wins, walking up). It receives:

Variable Description
content The document as HTML
title The document's title
current_path The URL being served, e.g. /docs/markdown
pages Every document in the directory: {route, url, label}

The docs layout builds its sidebar from pages: routes listed in its order come first, then anything else — so a new document appears in the navigation as soon as you save it.

Where the first documents come from

On startup, if storage has no markdown at all, Garden CMS copies in the files from data/md/ (set MD_SEED_DIR to use another folder). Once storage has any markdown, it is never overwritten.

Markdown features

Python-Markdown with fenced code blocks, tables, and heading anchors (toc).