Frontmatter
Frontmatter is YAML at the top of a file that defines page metadata.
Basic Syntax
Frontmatter is enclosed between two lines of three dashes. Example:
layout: _layouts._main.html
title: Page Title
description: Page description for SEOPlace this YAML between --- delimiters at the very top of your file, then add your content below.
Built-in Properties
| Property | Description |
|---|---|
layout | Template to wrap the content |
title | Page title (used in templates) |
description | Meta description |
cleanurl | If true, page.html → page/index.html |
Custom Properties
Add any properties you need:
layout: _layouts._post.html
title: My Post
date: 2024-01-15
author: Jane Doe
tags:
- javascript
- tutorialAccess them in templates:
<time>{{ meta.date }}</time>
<span>By {{ meta.author }}</span>
{% for tag in meta.tags %}
<span class="tag">{{ tag }}</span>
{% endfor %}Accessing in Templates
All frontmatter is available under meta:
<title>{{ meta.title }}</title>
<meta name="description" content="{{ meta.description }}">