Organize content with sections
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.
Related guides #
- Content model β sections, pages, and frontmatter in depth
- Configuration reference β full
content_dirsfield reference