Structure your site for different content types, audiences, or topics using Zorto’s section system.

Multiple content sections #

A typical site might have:

πŸ“‚content/
β”œβ”€β”€ πŸ“_index.mdsection: homepage
β”œβ”€β”€ πŸ“‚posts/
Β Β Β Β β”œβ”€β”€ πŸ“_index.mdsection: blog
β”œβ”€β”€ πŸ“‚docs/
Β Β Β Β β”œβ”€β”€ πŸ“_index.mdsection: documentation
β”œβ”€β”€ πŸ“‚projects/
Β Β Β Β β”œβ”€β”€ πŸ“_index.mdsection: portfolio
β”œβ”€β”€ πŸ“about.mdpage

Each section is independent β€” its own sort order, pagination, and template.

Section-specific templates #

Assign templates per section:

# content/docs/_index.md
+++
title = "Documentation"
template = "docs-section.html"
+++

Pages within the section can also use a custom template:

# content/docs/getting-started.md
+++
title = "Getting started"
template = "docs-page.html"
+++

Nested sections #

Sections can nest:

πŸ“‚content/docs/
β”œβ”€β”€ πŸ“_index.mdsection
β”œβ”€β”€ πŸ“‚getting-started/
Β Β Β Β β”œβ”€β”€ πŸ“_index.mdsection
Β Β Β Β β”œβ”€β”€ πŸ“installation.mdpage
β”œβ”€β”€ πŸ“‚reference/
Β Β Β Β β”œβ”€β”€ πŸ“_index.mdsection
Β Β Β Β β”œβ”€β”€ πŸ“cli.mdpage

Access subsections in templates via section.subsections.

External content directories #

Pull content from outside the content/ directory:

# config.toml
[[content_dirs]]
path = "../docs"
url_prefix = "docs"
template = "docs.html"
section_template = "docs-section.html"
sort_by = "title"
rewrite_links = true

This is useful for documentation that lives alongside source code in a separate directory or repository.