Overview

Front Matter allows you to customize your Pages individually, adding components or menus to just that page, changing the layout, or using configurations specific to the plugin it came from. The Front Matter is optional, but if used, it must be the first thing in the file. Front Matter can use any of Orchid's parser languages, but YAML is the most common, and comes between pairs of triple dashed lines, which is removed from the actual page output. Here's an example, which is the actual Front Matter of this current page:

---
title: Custom Page Title
description: Page Descriptiption
---

Front Matter Formats

Front Matter can use different languages in two ways: by specifying the language's extension after the first set of dashes, or by using "fences" for that languages. As an example, TOML uses +++ instead of ---, and JSON uses ;;;. The following blocks of TOML Front Matter are equivalent to the YAML Front Matter block above:

---toml
title = "Page Configuration"
customItems = [
  "Item One",
  "Item Two",
  "Item Three"
]
---

+++
title = "Page Configuration"
customItems = [
  "Item One",
  "Item Two",
  "Item Three"
]
+++

Custom Delimiters

Orchid allows you to define custom delimiters for extracting Front Matter, such as for compatibility purposes, or for using Front Matter as a comment when the normal syntax causes errors in your IDE.

Example: CSS Comments

# config.yml
services:
  compilers:
    customDelimeters:
      - regex: '^/\\*\n(.*)\n\\*/\n'
        group: '1'
        parser: 'yml'
        fileExtensions:
          - 'css'

 1 /*
 2 title: "Page Configuration"
 3 customItems: 
 4   - Item One
 5   - Item Two
 6   - Item Three
 7 */
 8 
 9 .button {
10   ...
11 }

Example: JBake Compatibility

# config.yml
services:
  compilers:
    customDelimeters:
      - regex: '^(.*?)\n~~~~~~\n'
        group: '1'
        parser: 'properties'
        fileExtensions:
          - 'md'

 1 title=Weekly Links #2
 2 date=2013-02-01
 3 type=post
 4 tags=weekly links, java
 5 status=published
 6 ~~~~~~
 7 
 8 # Markdown content
 9 
10 ...

See Also:

Edit this page