Ignore

Please note that your browser is not supported.

We recommend upgrading to the latest Firefox or Google Chrome.

Frontend: Front-Matter

Pakyow view templates support a technique called front matter to set configuration values that change the behavior of the view being rendered. To use front matter, simply add code that looks like the following example to the top of any view template:

---
key: value
---

You can place any valid YAML configuration within the --- bookends. Pakyow will parse the front matter from the template and expose the values to backend code.

Reference

Here's a reference guide for all the built-in use cases of front matter:

Setting the layout

---
layout: layout-name
---

Setting the page title

---
title: value
---

Defining default presentation modes

---
modes:
- mode-1
- mode-2
- mode-3
---

Including asset packs

---
packs:
- pack-1
- pack-2
- pack-3
---

Learn more about asset packs

Inheritance

Front matter values defined in a layout are inherited by any page that uses the layout. For example, if the layout defines a page title like this:

---
title: Layout Title
---

Every page will receive the same title. Pages can override the inherited value by simply redefining the title value in their own front matter:

---
title: Page-Specific Title
---
Next Up: Supported Formats