Collections

Configure content collections — posts, docs, and pages — with pagination, date handling, and RSS.

Overview

Collections are groups of related content. Each collection has its own directory under content/, URL prefix, and template. Three presets are available:

PresetDirectoryDatedRSSListedNestedURL Pattern
postscontent/posts/YesYesYesNo/posts/slug
docscontent/docs/NoNoYesYes/docs/slug
pagescontent/pages/NoNoNoNo/slug

Defining Collections

Collections are configured in page.toml:

[[collections]]
name = "posts"

[[collections]]
name = "docs"

[[collections]]
name = "pages"

Each preset comes with sensible defaults. You can override any field:

[[collections]]
name = "posts"
label = "Blog"
paginate = 10

Collection Fields

FieldTypeDefaultDescription
namestringrequiredCollection identifier
labelstringcapitalized nameDisplay name in templates
directorystringnameContent directory under content/
url_prefixstring/nameURL prefix for items
default_templatestringpreset-basedTemplate file for rendering
has_dateboolpreset-basedItems have dates
has_rssboolpreset-basedInclude in RSS feed
listedboolpreset-basedShow on index page
nestedboolpreset-basedSupport subdirectories as groups
paginateintnoneItems per page (enables pagination)

Posts

Posts are date-based content. Filenames should include the date:

content/posts/
├── 2026-01-15-hello-world.md
├── 2026-02-01-rust-tips.md
└── 2026-02-18-new-feature.md

The date is parsed from the filename (YYYY-MM-DD-slug.md) or from frontmatter. Posts are sorted by date (newest first) and included in the RSS feed.

Docs

Docs support nested directories for grouped navigation:

content/docs/
├── getting-started.md
├── guides/
│   ├── setup.md
│   └── advanced.md
└── reference/
    ├── api.md
    └── config.md

Nested docs get URLs like /docs/guides/setup. The docs theme shows a sidebar with sections grouped by directory.

Pages

Pages are standalone content at root URLs. They're unlisted (not shown on the index page):

content/pages/
├── about.md        → /about
├── contact.md      → /contact
└── index.md        → / (homepage content)

The special file content/pages/index.md injects its content into the homepage template as {{ page.content }}.

Pagination

Enable pagination on any listed collection:

[[collections]]
name = "posts"
paginate = 10

This generates:

  • /posts/ — page 1
  • /posts/page/2/ — page 2
  • /posts/page/3/ — page 3, etc.

Templates receive pagination context:

{{ pagination.current_page }}
{{ pagination.total_pages }}
{{ pagination.prev_url }}
{{ pagination.next_url }}

Singular/Plural

Both page new post and page new posts work — the CLI normalizes singular to plural automatically.

Tag Pages

Tags are collected from all posts and generate archive pages:

  • /tags/ — tag index with all tags and counts
  • /tags/rust/ — all posts tagged "rust"

Tag pages are i18n-aware and included in the sitemap.