Frontmatter Reference

Complete reference for all frontmatter fields

4 min read 779 words

Complete reference for all frontmatter fields available in Bengal pages.

Required Fields

Field Type Description
title string Page title, used in navigation and<title>tag

Common Fields

Field Type Default Description
description string Page description for SEO and previews
date datetime file mtime Publication date
draft boolean false Iftrue, page is excluded from production builds
weight integer 0 Sort order (lower = first)
slug string filename URL slug override
url string Complete URL path override
aliases list [] Additional URLs that redirect to this page

Taxonomy Fields

Field Type Description
tags list Tags for categorization
categories list Categories for grouping
keywords list SEO keywords
authors list Page authors (strings or objects)
author string/object Single author (string key or nested object)

Author Patterns

Bengal supports multiple author patterns for flexibility:

Simple string (reference to data registry):

author: lbliii

Nested object (inline):

1
2
3
4
author:
  name: Lawrence Lane
  github: lbliii
  bio: Technical writer and developer

Multiple authors (list of strings or objects):

1
2
3
4
authors:
  - lbliii
  - name: Jane Smith
    github: janesmith

Flat author fields (legacy pattern):

1
2
3
4
5
6
7
author: Lawrence Lane
author_avatar: /images/lawrence.jpg
author_title: Senior Developer
author_bio: Technical writer and developer
author_links:
  - text: GitHub
    url: https://github.com/lbliii

Author Data Registry

Define authors once indata/authors.yamland reference by key:

1
2
3
4
5
6
# data/authors.yaml
lbliii:
  name: Lawrence Lane
  github: lbliii
  bio: Technical writer and developer
  avatar: /images/lawrence.jpg

Then reference in frontmatter:

author: lbliii

Access in templates:

1
2
{% set author_info = site.data.authors[page.metadata.author] %}
{{ author_info.name }}{{ author_info.bio }}

Layout Fields

Field Type Default Description
layout string Visual variant (maps todata-varianton body). To change the template file, usetemplate.
type string section name Content type (determines default strategy and template)
template string Explicit template path (e.g.,blog/single.html)

SEO Fields

Field Type Description
canonical string Canonical URL for duplicate content
noindex boolean Iftrue, addsnoindexmeta tag
og_image string Open Graph image path
og_type string Open Graph type (article, website, etc.)
Field Type Description
menu object Menu placement configuration
nav_title string Short title for navigation (falls back totitle)
parent string Parent page for breadcrumbs

Advanced Fields

Field Type Description
cascade object Values to cascade to child pages
outputs list Output formats (html, rss, json)
resources list Page bundle resource metadata

Custom Fields

Any fields not part of Bengal's standard frontmatter are automatically available as custom fields. Simply add them at the top level of your frontmatter.

Standard fields (extracted to PageCore):

  • title,description,date,draft,weight,slug,url,aliases,lang
  • tags,categories,keywords,authors,category
  • type,variant,layout,template
  • canonical,noindex,og_image,og_type
  • menu,nav_title,parent
  • cascade,outputs,resources,toc

Custom fields (any other fields):

  • Any field not listed above goes intopage.props
  • Access viapage.metadata.get('field_name')orpage.props.get('field_name')

Example

1
2
3
4
5
6
7
8
9
---
title: My Page
description: Page description
weight: 10
type: doc
icon: code
card_color: blue
custom_setting: value
---

Access custom fields via:

  • page.metadata.get('icon')orpage.props.get('icon')
  • page.metadata.get('card_color')
  • page.metadata.get('custom_setting')

Note: Theprops:key is only used in skeleton manifests (bengal project skeleton apply). For regular markdown files, use flat frontmatter (all fields at top level).

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
---
title: Getting Started with Bengal
description: Learn how to install and configure Bengal for your first site
date: 2025-01-15
draft: false
weight: 10
tags: [tutorial, beginner]
categories: [Getting Started]
authors: [jane-doe]
layout: tutorial
cascade:
  type: doc
difficulty: beginner
time_estimate: 15 minutes
---

Cascade Configuration

Thecascadefield applies values to all descendant pages:

1
2
3
4
5
6
7
---
title: Documentation
cascade:
  type: doc
  layout: docs
  draft: false
---

All pages under this section inherit these values unless they override them.