Front Matter
The Front Matter configuration for posts controls many aspects of the generated content. All markdown files in the posts
folder should start with a YAML front matter block in between the three dashes separator as follows:
---
page: post
title: Hello
---
published: Boolean
This controls if the current post will be published or not. If the value is set to false
then the post will not appear in any of the lists and won't be exported.
Default value is true
category: String
Defines the category for a post. This is optional. The default value is taken from directory hierarchy in the posts
folder. If you create a post under /posts/food
folder then category
is set to food
by default.
Subcagetories are separated by /
following the directory structure.
Example
---
page: docs
category: api
---
Welcome to the Documentation!
date: String
The date to be used for sorting posts in a list when using sortByDate
from nextein/post
. If the post name starts with a date YYYY-MM-DD
format, that will be assigned as the default value or the file creation date if available.
Example
---
page: docs
category: api
date: 2017-10-04
---
Welcome to the Documentation!
Or by the file name:
/posts/2017-06-09-my-awesome-post.md
name: String (Read Only)
The post file name. If the name contains a date, it is removed from the final name.
Custom Variables
You can define your own variables in front matter. All variables will be accesible from the post data
object.
Example
---
title: My Awesome Post
tag: awesome
category: hot
---
Content