We are working very hard to bring you the best documentation possible.
HTML DOCUMENTS
Posts
Required: No
Front Matter: Yes
Type: .html, .md
Project Location: src/templates/posts
Posts are specialized templates that can be useful for creating blog-like HTML documents, or any type of HTML document that would benefit from a chronologically ordered folder structure, tags and categories.
In metadata, posts can be identified by their "isPost": true property.
Naming Convention
Unlike all other templates, post templates have a strict naming convention, e.g . 2023-02-28-upsidedown-cake.md, which allows fusion.ssg to structure your posts chronologically. Post template names must begin with the year, -, month, -, and day (i.e., YYYY-MM-DD), followed by a dash (i.e., -), and ending with the actual file name, including its type, i.e. [file name].md|html.
For example, a post without categories (see below) named 2023-02-28-upsidedown-cake.md would be rendered to the posts folder as 2003/02/28/upsidedown-cake/index.html, and a post with categories "recipes, cakes" named 2023-02-28-upsidedown-cake.md would be rendered to the posts folder as recipes/cakes/2003/02/28/upsidedown-cake/index.html.
Categories
Categories are strictly for rendering posts in a particular folder hierarchy. For example, a post with a single category, such as "recipes", would be rendered in the "posts/recipes/" folder and a post with two categories, such as "recipes, cakes and pies", would be rendered in the "posts/recipes/cakes and pies" folder/.
Categories are declared in a post's front matter as shown below:
post: {
categories: "category, ..."
}
Tags are very useful for associating posts that have similar subject matter. Components can query metadata using higher order array functions, such as filter for example, to find all posts with a particular tag.
Tags are declared in a post's front matter as shown below:
post: {
tags: "tag, ..."
}
---
page: blog
tokens: {
title: "Yada Yada"
}
post: {
tags: "yada yada",
categories: "TV Series, Seinfeld, S8, E19"
}
---
Yada yada...
<!-- end -->
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Possimus quo dolor dolorum, vel temporibus impedit quam animi, aliquam porro assumenda tenetur iure nemo voluptas voluptates quis distinctio, eveniet suscipit aliquid.
Post Specific Simple Tokens
Introduced in v1.2.0
Besides the simple tokens that you define in your template's front matter and globally in your project's fusion.json file, fusion.ssg also defines numerous simple tokens, whose values it has obtained from the meta data associated with your posts templates, that you can use. Please see Auto Generated Tokens for details.