Customizing Stattic: Front Matter Fields

Below is a comprehensive list of all of the front matter fields that are used by Stattic.

1. title

title: "Your Post Title"`

2. date

date: "2023-10-15T10:00:00"

3. author

metadata:
    author: 1  # Corresponds to an author defined in authors.yml

4. categories

categories:
    - 2
    - 5

5. tags

tags:
    - 3
    - 7

6. draft

draft: true  # The post will be skipped during the build process

7. template

template: "custom"  # Will use 'post-custom.html' or 'page-custom.html'

8. custom_url

custom_url: "my-custom-path"

9. order

order: 1  # Used by custom logic for navigation ordering

10. featured_image

featured_image: "https://example.com/images/featured.jpg"

11. seo_title

seo_title: "Optimized SEO Title for Search Engines"

12. keywords

keywords: "keyword1, keyword2, keyword3"

13. description

description: "A brief description of the content for SEO purposes."

14. lang

lang: "en"

15. excerpt

excerpt: "This is a custom excerpt for the post."

16. permalink

permalink: "exploring-the-stars"

Additional Details and Usage

Categories and Tags

# categories.yml
1:
    name: "Technology"
2:
    name: "Science"

# tags.yml
1:
    name: "Python"
2:
    name: "AI"
categories:
    - 1  # Refers to "Technology"
    - 2  # Refers to "Science"
tags:
    - 1  # Refers to "Python"
    - 2  # Refers to "AI"

Authors

# authors.yml
1: "Jane Doe"
2: "John Smith"
author: 1  # Refers to "Jane Doe"

Custom Templates

template: "gallery"  # Will use 'post-gallery.html' or 'page-gallery.html'

Example of Complete Front Matter

---
title: "Exploring the Stars"
date: "2023-10-15T10:00:00"
author: 2
categories:
    - 3
    - 4
tags:
    - 5
    - 6
draft: false
template: "astronomy"
custom_url: "exploring-the-stars"
order: 2
featured_image: "https://example.com/images/stars.jpg"
seo_title: "A Deep Dive into Astronomy"
keywords: "astronomy, stars, space"
description: "An in-depth exploration of the wonders of the universe."
lang: "en"
excerpt: "Join us as we journey through the cosmos, exploring the mysteries of the stars..."
---

Notes on Usage

Example:

---
title: "My Post Title"
date: "2024-04-22"
---

Default values are applied automatically if a field is missing.

If the date is invalid or missing, a default fallback will be used (e.g., the current date or minimum sort date).

Summary

By defining values in your Markdown file's front matter, you gain fine-grained control over how content is handled, presented, and optimized by Stattic.

Whether you're managing SEO, structuring navigation, hiding drafts, or linking to custom permalinks, front matter fields let you customize:

You can include as few or as many of these fields as needed. Stattic will fill in any gaps with sensible defaults--so your content builds fast, clean, and reliably.