Category: Behind the scenes
How this example blog works under the hood
This is the site template’s example post. It is here to show how the blog works — replace it with the first real piece.
One file per language
Each post is a Markdown file in src/content/blog/{language}/. The Portuguese version of this text has the same file name in the pt-br/ folder, and that name is what links the two: the language switcher and the hreflang tags point from one to the other.
A post that exists in one language only is published too. Its page simply stops advertising a version that does not exist.
Validated at publish time
Each file’s front matter goes through a schema before the build:
- title, description and category are required;
- the date has to be a valid date;
- the language has to be one the site publishes;
- the cover image is optional — a post without a real image ships without one.
If any of those fields is wrong, publishing stops and says which file to fix.
No JavaScript
The listing and the posts are static HTML. Nothing has to run in the browser for the text to appear, and search engines read the whole post.