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 ---
page: String | false
page variable points to the page component used to render the post content. In case the current post is not intended to be rendered by itself, we can pass
false as a parameter.
Default value is
If we define the
docs, the post will be rendered using
--- page: docs --- Welcome to the Documentation!
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
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.
--- page: docs category: api --- Welcome to the Documentation!
The date to be used for sorting posts in a list when using
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.
--- page: docs category: api date: 2017-10-04 --- Welcome to the Documentation!
Or by the file name:
The permalink can override the generated uri for the post.
Default values is
:Indicates that is a variable from the post front matter data.
?Indicates the variable is optional.
All front matter variables, even custom ones, can be used to define the permalink.
name: String (Read Only)
The post file name. If the name contains a date, it is removed from the final name.
url: String (Read Only)
The generated url for the post based on the permalink.
You can define your own variables in front matter. All variables will be accesible from the post
--- title: My Awesome Post tag: awesome category: hot --- Content