Skip to main content

Frontmatter Reference

Every Markdown file in content/ starts with a YAML frontmatter block. This page documents every field Pycora Pro reads.


Basic Structure​

---
layout: layouts/post
title: "My Post"
description: "A short description"
date: 2026-01-15
tags: [python, ssg]
author: Axcora
---

The block starts and ends with ---. Everything below the closing --- is the body.


Common Fields​

These fields appear in every content file:

FieldTypeRequiredDescription
layoutstringYesTemplate to use (e.g., layouts/post)
titlestringYesPage or post title
descriptionstringNoMeta description for SEO
imagestringNoSocial share / featured image
datedateNoPublish date (YYYY-MM-DD)
tagslistNoTags for categorization
authorstringNoAuthor name
keywordsstringNoSEO keywords

Page Fields​

Pages (Home, About, Contact) use these extra fields:

FieldTypeDescription
bodystringMarkdown body (About Page)
heroobjectHero section (Home Page)
trustedobjectTrusted logos (Home Page)
introobjectIntro section (Home Page)
intro_grid1objectFirst grid block (Home Page)
intro_grid2objectSecond grid block (Home Page)
intro_grid3objectThird grid block (Home Page)
statsobjectStats counters (Home Page)
journalobjectJournal link (Home Page)
projectsobjectProjects link (Home Page)
testimonialobjectClient quote (Home Page)

See Home Page Reference for the full structure.


Controller Fields​

Controllers are Markdown files with a collection: key:

FieldTypeRequiredDescription
collectionstringYesCollection to list (posts, projects)
paginationnumberNoItems per page
sort_bystringNoSort field (date, title)
sort_orderstringNoasc or desc
filterobjectNoMetadata filter
limitnumberNoMaximum items

See Controllers for full details.


Project Fields​

Project entries use these fields:

FieldTypeRequiredDescription
layoutstringYeslayouts/project-detil
infostringYesShort category label
titlestringYesProject name
descriptionstringNoShort summary
imagestringNoFeatured image
clientstringNoClient name
yearsstringNoProject year
datedateNoPublish date
tagslistNoTags
authorstringNoAuthor name

Post Fields​

Blog posts use these fields:

FieldTypeRequiredDescription
layoutstringYeslayouts/post
titlestringYesPost title
descriptionstringNoShort summary
imagestringNoFeatured image
datedateNoPublish date
authorstringNoAuthor name
tagslistNoTags

Date Formats​

Pycora Pro accepts multiple date formats:

FormatExample
ISO2026-01-15
ISO with time2026-01-15T10:30:00
Long formJanuary 15, 2026

For sorting to work, use ISO (YYYY-MM-DD).


Tags​

Tags can be written three ways:

Inline Array​

tags: [python, ssg, jamstack]

Multiline List​

tags:
- python
- ssg
- jamstack

Comma-Separated String​

tags: "python, ssg, jamstack"

All three are parsed into a list.


Nested Objects​

Frontmatter can contain nested objects:

hero:
info: "Axcora Lab"
title1: "We Build"
title2: "Structures"
title3: "That Last."
button1:
text: "Get Started"
url: "/contact/"
image:
url: "/img/hero.avif"
alt: "Hero image"

Access in templates:

{{ hero.title1 }}
{{ hero.button1.text }}
{{ hero.image.url }}

Missing Fields​

If a field is missing, Pycora Pro returns a ChainableUndefined — a safe placeholder. Templates do not crash.

{{ post.author }} {# empty if missing #}
{{ post.author.name }} {# empty if nested missing #}
{{ post.author | default("Anonymous") }}

Use default() for fallbacks.


Validation​

Pycora Pro does not validate frontmatter. Invalid YAML will fail the build with a parse error.

Before committing, verify:

  • All keys are lowercase with hyphens or underscores
  • Strings with special characters are quoted
  • Dates are ISO format
  • Lists use - or []

Best Practices​

  • Quote strings with special characters: "Pycora — Python SSG"
  • Use ISO dates: 2026-01-15
  • Keep tags lowercase: python, not Python
  • Use consistent field names across files in the same collection
  • Do not add custom fields unless you edit the templates to use them

Troubleshooting​

Build fails with a YAML error​

  1. Check the YAML syntax — indentation matters
  2. Look for tabs — YAML uses spaces only
  3. Check for missing --- at the top or bottom

Field is empty in the output​

  1. Check that the field name matches the template variable
  2. Check that the field is not nested incorrectly
  3. Use | default() for optional fields

Date sorting does not work​

  1. Use ISO format: YYYY-MM-DD
  2. Check that dates are not quoted (date: 2026-01-15, not date: "2026-01-15")

Tags do not create tag pages​

  1. Check that tags has at least one item
  2. Rebuild the site


What's Next?​