Content

Content in Taxus is written in Markdown files with TOML frontmatter.

Content Files

Content files are stored in the content/ directory:

content/
├── _index.md      # Home page
├── about.md       # About page
└── blog/
    ├── _index.md  # Blog section index
    ├── first-post.md
    └── second-post.md

Special Files

FilePurpose
_index.mdSection index page (home page at root, section index in subdirectories)
*.mdRegular pages

Co-located Assets

Non-Markdown files in the content directory are automatically copied to the output directory, preserving their relative paths. This allows you to keep images and other assets alongside the content that uses them.

content/
├── blog/
│   ├── first-post.md
│   ├── photo.jpg          → dist/blog/photo.jpg
│   └── diagrams/
│       └── architecture.png  → dist/blog/diagrams/architecture.png
└── about/
    ├── about.md
    └── headshot.png       → dist/about/headshot.png

Referencing co-located assets:

![Photo](photo.jpg)
![Diagram](diagrams/architecture.png)

Or use absolute paths from the site root:

![Photo](/blog/photo.jpg)

When to use co-located assets:

  • Blog post images and diagrams
  • Page-specific downloads (PDFs, etc.)
  • Content-specific data files

For global assets (logos, favicons, shared images), use the static/ directory instead.

Hero Images

Pages can have a hero image — a prominent image displayed at the top of the page. Place the image file next to your markdown and reference it in frontmatter:

+++
title = "My Post"
hero_image = "sunset.jpg"
hero_alt = "A dramatic mountain sunset"
date = 2024-03-15
+++

# My Post

Taxus automatically:

  • Generates responsive variants at multiple widths (default: 400, 800, 1200)
  • Converts to WebP (or JPEG/PNG if configured)
  • Produces a <picture> element with srcset for optimal browser delivery
  • Falls back to the page title if hero_alt is not provided

See Images for full configuration and template usage.

Frontmatter

Each Markdown file can include TOML frontmatter enclosed in +++:

+++
title = "Page Title"
description = "A brief description"
date = 2024-01-15
template = "custom.html"
draft = false

[extra]
author = "John Doe"
tags = ["rust", "web"]
+++

# Page Content

Your markdown content here.

Frontmatter Fields

FieldTypeRequiredDefaultDescription
titlestringNo*""Page title
descriptionstringNoNonePage description for SEO
datedateNoNonePublication date (YYYY-MM-DD)
updateddateNoNoneLast updated date
templatestringNo"page.html"Template override
draftboolNofalseDraft status
summarystringNoNoneCustom summary/excerpt
slugstringNoNoneCustom URL slug
aliasesarrayNo[]Old URLs that redirect to this page
tagsarrayNo[]Tags (e.g., ["rust", "web"])
categoriesarrayNo[]Categories (e.g., ["tutorial"])
seriesstringNoNoneSeries name (e.g., "Learning Rust")
sort_bystringNo"date"Sort order for sections: "date", "title", "weight", "none"
paginate_bynumberNo0Items per page (0 = no pagination)
paginate_templatestringNoNoneTemplate for paginated pages
weightnumberNo0Weight for manual ordering
hero_imagestringNoNoneRelative path to a co-located hero image
hero_altstringNoNoneAlt text for hero image (falls back to page title)
extratableNoNoneCustom metadata

*Title is recommended but not required by the library.

Date Format

Dates use the TOML date format:

date = 2024-01-15
updated = 2024-02-20

Extra Metadata

The extra field allows custom metadata:

[extra]
author = "Jane Doe"
custom_field = "any value"

Access extra metadata in templates through the extra variable.

URL Path Generation

Content files are mapped to URL paths:

Content FileURL Path
content/_index.md/
content/about.md/about/
content/blog/_index.md/blog/
content/blog/my-post.md/blog/my-post/

Custom Slugs

Override the default URL path using the slug frontmatter field:

+++
title = "My First Post"
slug = "hello-world"
+++

This creates /blog/hello-world/ instead of /blog/my-first-post/.

Markdown Support

Taxus supports standard Markdown syntax:

Headings

# Heading 1
## Heading 2
### Heading 3

Lists

- Unordered item
- Another item

1. Ordered item
2. Another item
[Link text](https://example.com)

Reference other pages by their content file path with build-time validation:

See my [about page](@/about.md) for more details.
Check out this [blog post](@/blog/first-post.md).

The @/ prefix signals an internal link. Paths are relative to content/.

Markdown LinkResolved HTML
[about page](@/about.md)<a href="/about/">about page</a>
[blog post](@/blog/post.md)<a href="/blog/post/">blog post</a>

If an internal link references a non-existent file, the build fails with a clear error.

Images

![Alt text](/images/photo.png)

Code

Inline `code` in text.

```rust
fn main() {
    println!("Hello, world!");
}
```

Code blocks with a language identifier are highlighted using tree-sitter. See Syntax Highlighting for configuration and supported languages.

Blockquotes

> This is a blockquote.

Blog Features

Summary and Excerpt

Taxus automatically extracts a summary for each page:

  1. Automatic extraction: First paragraph of content
  2. Manual marker: Use <!-- more --> to mark where summary ends
  3. Frontmatter override: Set a custom summary in frontmatter
+++
title = "My Post"
summary = "A custom summary for SEO"
+++

This is the first paragraph.

<!-- more -->

The rest appears after the summary...

Access in templates: {{ page.summary }}

Reading Time and Word Count

Each page calculates reading time (200 words/minute) and word count:

<span class="reading-time">{{ page.reading_time }} min read</span>
<span class="word-count">{{ page.word_count }} words</span>

Taxonomies

Taxus supports three taxonomy types:

Tags

Multiple keywords associated with a page:

+++
title = "Introduction to Rust"
tags = ["rust", "programming", "tutorial"]
+++

Categories

Broader classifications (also multiple):

+++
title = "My Tutorial"
categories = ["tutorial", "beginner"]
+++

Series

Groups related posts in a sequence (single value):

+++
title = "Part 1: Getting Started"
series = "Learning Rust"
+++

Taxonomy Pages

Taxus generates taxonomy listing and term pages automatically when the corresponding templates exist. The scaffold (taxus init) creates all six templates:

TemplateURLPurpose
tags.html/tags/Lists all tags
tags_term.html/tags/rust/Lists pages with the "rust" tag
categories.html/categories/Lists all categories
categories_term.html/categories/tutorial/Lists pages in "tutorial" category
series.html/series/Lists all series
series_term.html/series/learning-rust/Lists pages in "Learning Rust" series

If a template is missing, that particular page is skipped silently. See Templates for the full taxonomy template context and examples.

Pagination

Enable pagination in a section's _index.md:

+++
title = "Blog"
sort_by = "date"
paginate_by = 10
+++

# Blog

Welcome to my blog!

Pagination Configuration

FieldTypeDefaultDescription
sort_bystring"date"Sort order: "date", "weight", "title", "none"
paginate_bynumber0Pages per slice (0 = no pagination)
paginate_templatestringNoneTemplate for paginated pages

Pagination URLs

  • /blog/ — First page
  • /blog/page/2/ — Second page
  • /blog/page/3/ — Third page

Pagination in Templates

{% if section.pagination %}
<nav class="pagination">
  {% if section.pagination.prev %}
  <a href="{{ section.pagination.prev }}">← Previous</a>
  {% endif %}
  
  <span>Page {{ section.pagination.current }} of {{ section.pagination.total }}</span>
  
  {% if section.pagination.next %}
  <a href="{{ section.pagination.next }}">Next →</a>
  {% endif %}
</nav>
{% endif %}

RSS/Atom Feeds

Configure feeds in site.toml:

[feed]
rss_enabled = true
atom_enabled = true
limit = 20
full_content = false

Feed Entry Fields

FieldSource
TitlePage title
DescriptionPage description or auto-extracted summary
URLFull page URL (base_url + path)
PublishedPage date field
UpdatedPage updated field (Atom only)

Feed URLs

  • RSS: https://example.com/rss.xml
  • Atom: https://example.com/atom.xml

Sitemap Generation

Taxus generates sitemap.xml automatically:

  • All routes included (pages and sections)
  • Draft pages excluded
  • Last modification date from page date field
  • Priorities: home 1.0, sections 0.8, pages 0.7

Sitemap URL

https://example.com/sitemap.xml

Robots.txt Generation

Taxus generates robots.txt automatically if no static/robots.txt exists:

User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml

To provide a custom robots.txt, create it in static/.