Sha256: 65bcb6d61d4122f1629cf285b1823b01950c552a1473a88cd209ac52548f2077

Contents?: true

Size: 1.91 KB

Versions: 1

Compression:

Stored size: 1.91 KB

Contents

---
title:  Front Matter
blurb:  <em>Middleman</em> (and hence <em>Middlemac</em>) source files use
        front matter to control many features of pages.
layout: template-logo-medium
---
<%= md_links %>
<%= md_images %>

<%= current_page.data.title %>
==============================

<%= current_page.data.blurb %>

Front matter is a document header section that contains key-value data that
applies to a page. This data can be referred to later for output or control.
For example, the title of this page was specified with a `title:` key in the
source document’s front matter, and its layout was specified with a `layout:`
key.

Front matter can also control page order (a feature of _Middleman_’s
`middleman-pagegroups` gem), inclusion of pages for targets/features (provided
by the `middleman-targets` gem), and more.

Here’s this document’s front matter:

~~~ yaml
---
title:  Front Matter
blurb:  <em>Middleman</em> (and hence <em>Middlemac</em>) source files use
        front matter to control a lot of features of pages.
layout: template-logo-medium
---
~~~

## Declaring Front Matter

Front matter is defined as being delimited at the beginning and end with a line
consisting of a series of three hyphens (`-`), and this block must appear at the
top of a document.

Although specific front matter keys are discussed elsewhere in this
documentation it’s worth pointing out that the `title:` and `:blurb` are used
extensively in _Middlemac_. For example all of the automatic navigation
features are built using this data, meaning that this data need only appear
once, here, in this very document.

## Markdown in Front Matter

You may have noticed that the front matter contains HTML. Because the front
matter consists of data rather than content specifically targeted for display,
it is not processed by the Markdown engine. Front matter is one of the very
few places in a _Middlemac_ project where you have to revert to using HTML.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
middlemac-2.0.0 documentation_project/Contents/Resources/Base.lproj/030_skills_refresher/20_frontmatter_skill.html.md.erb