A template with front matter.
---
title: Hello
slug: home
---
<h1>Hello world!</h1>
The above results in a JavaScript object like this:
{
content: '<h1>Hello world!</h1>',
data: {
title: 'Hello',
slug: 'home'
}
}
We are working very hard to bring you the best documentation possible.
HTML DOCUMENTS
Front matter, specifically YAML front matter, is integral to fusion.ssg's build process and though not technically required, every template should include YAML front matter at the very top of the file, even when the template has no content of its own and its front matter is empty.
Wherever "front matter" is mentioned on its own, assume it refers to "YAML front matter".
fusion.ssg relies on the open source library gray-matter to convert YAML front matter to JavaScript.
A template with front matter.
---
title: Hello
slug: home
---
<h1>Hello world!</h1>
The above results in a JavaScript object like this:
{
content: '<h1>Hello world!</h1>',
data: {
title: 'Hello',
slug: 'home'
}
}
Excerpts are also supported.
---
title: Hello
slug: home
---
This is an excerpt.
<!-- end -->
<h1>Hello world!</h1>
The above results in a JavaScript object like this:
{
content: 'This is an excerpt. <h1>Hello world!</h1>',
data: {
title: 'Hello',
slug: 'home'
},
excerpt: "This is an excerpt."
}