Adding a blog
You have created your first pages and now you want more, you want to create a blog! What differentiates normal pages from a blog :
- Blog pages have a special layout created by your theme.
- Blogs offer RSS feeds that your readers can subscribe to.
- Shortcodes and hotcodes can access the content of a blog (e.g. to display a list of posts)
To create a blog, you must create a folder in the source
folder for it. Then add this blog to your configuration and populate this folder with posts.
Example : Creating the CESTOLIV's blog
The blog will have to be accessible at the address https://cestoliv.com/blog
: you have to create a blog
folder in the source
folder : it is in this folder that you will find the posts.
You must then add the blog to the configuration :
content:
title: "cestmaddy"
language: en
header: "header.md"
footer: "footer.md"
theme: "tailwind"
favicon: {
path: "res/img/monogram_color.svg",
background: "#eaeaea",
theme_color: "#1a1a1a"
}
# end of basic configuration
blogs: {
"CESTOLIV": {
dir: "blog",
description : "A tech blog",
category: "Technology",
language: "en",
main_author: "cestoliv",
authors: {
"cestoliv": "me@cestoliv.com"
},
},
}
dir
: The path to the blog folder (in thesource
folder)description
: The description of the blogcategory
: The category of the blog (for the RSS feed, it is recommended to use a category that is already in the list of IAB)language
: The language of the blog on 2 characters (ISO 639-1)main_author
: The main author of the blog (must be in theauthors
list)authors
: The list of authors of the blog
Creating a post
To create a post, you must create a markdown file in the blog folder. The name of the file will be the slug of the post.
You can also create a post.md
in a folder, the name of the folder will be the slug of the post (same behavior as index.md
for pages).
Example : Creating three post
We will create three posts in the blog
folder, using the three different methods.
source
├── blog
│ ├── hello-world.md # cestoliv.com/blog/hello-world
│ ├── serie/fist-post.md # cestoliv.com/blog/serie/first-post
│ └── using-cestmaddy
│ └── post.md # cestoliv.com/blog/using-cestmaddy
└── config.yaml
The post file
---
title: Hello world
date: 2022-07-15T21:14:32
author: cestoliv
enclosure: hello-world.webp
description: This is my first post
---
## Hello world
This is my first post
title
: The title of the postdate
: The date of the post (ISO 8601)author
: The author of the post (must be a key in theauthors
list of the blog configuration)enclosure
: The path to the image that will be used as the thumbnail of the post. Can be a relative path or an absolute path.description
: The description of the post