Frontmatter

All pages optionally support having some metadata associated with them, called the frontmatter.

The frontmatter metadata is formatted using yaml and surrounded, above and below, with ---.

Example:

---
title:   My first Blogpost
published_date:    2016-01-01 21:00:00 +0100
layout: posts.liquid
---
Hey there this is my first blogpost and this is super awesome.

My Blog is lorem ipsum like, yes it is..

Default Frontmatter

---
title: ~
description: ~
published_date: ~
format: Raw
layout: ~
is_draft: false
permalink: path
slug: ~
excerpt_separator: "\n\n"
excerpt: ~
categories: []
tags: ~
data: {}
---

Overriding defaults from filename

Cobalt will infer some information from the filename.

Recognized name formats include:

  • slug.extension
  • YYYY-MM-DD-slug.extension
  • YYYY-MM-DD slug.extension

The two later ones are only recognised on build as publish managed the published_date and prepend the date to the filename by default.

MetadataInferred Default
slugThe slug portion of the name.
titleA best-effort at making a title from the slug portion.
published_dateThe YYYY-MM-DD portion, if present.
formatMarkdown if extension is md.
is_drafttrue if in the drafts folder.

Field Descriptions

MetadataFormatDescription
titleStringThe user-friendly name of the page.
descriptionStringThe description of the page's content.
published_dateYYYY-MM-DD HH:MM:SS TZThe date the page was initially published.
formatRaw, MarkdownContent format that needs parsing.
layoutString or nullThe layout template that wraps the page content, if present.
is_draftBooleanIf true, not published by default.
permalinkStringThe path for the generated page in destination.
slugStringThe path-friendly name of the file for use in permalinks
excerpt_separatorStringA marker for what leading content should be extracted from the content as an excerpt. "" will cause no excerpt to be generated.
excerptStringManually override the extracted excerpt. This will be processed like a page.
categoriesList of StringsHierarchical categories this page lives under.
tagsList of StringsTags attached to the page.
dataObjectUser-defined data available at page.data.