The blog module provides the basic layouts and templates for blog site.
Module | github.com/hbstack/blog |
---|---|
Repository | ⭐ Please consider giving a star if your like it. |
Stars | |
Version | |
Used by | |
Requirements | |
License | |
Usage | See how to use modules. |
Parameter | Type | Default | Description |
---|---|---|---|
blog.full_width | boolean | false | Whether take full width. |
blog.paginate | number | 9 | How many posts per list page. |
blog.post_date_format | string | :date_long | The date format. |
blog.post_thumbnail | boolean | true | Whether to display thumbnail. |
blog.post_thumbnail_default | string | images/thumbnail.png | The default thumbnail image relative to assets folder. |
blog.post_thumbnail_placeholder | string | Site’s title | The thumbnail placeholder. |
blog.archives | object | Archives settings. | |
blog.archives.paginate | number | 30 | How many posts per page. |
blog.home | object | Homepage settings. | |
blog.home.featured_posts | number | 10 | The number of featured posts. |
blog.home.main_sections | array | - | The main sections of posts, default to ALL. |
blog.home.taxonomies | boolean | true | Whether to show the taxonomies stat on home page. |
terms.paginate | number | 12 | The number of posts per term list page. |
params.toml
1[hb]
2 [hb.blog]
3 full_width = false
4 paginate = 12
5 post_date_format = ':date_long'
6 post_thumbnail = true
7 post_thumbnail_default = 'images/thumbnail.png'
8 post_thumbnail_placeholder = ''
9 [hb.blog.archives]
10 paginate = 30
11 [hb.blog.home]
12 featured_posts = 5
13 main_sections = ['docs', 'blog']
14 taxonomies = true
15 [hb.terms]
16 paginate = 12
params.yaml
1hb:
2 blog:
3 archives:
4 paginate: 30
5 full_width: false
6 home:
7 featured_posts: 5
8 main_sections:
9 - docs
10 - blog
11 taxonomies: true
12 paginate: 12
13 post_date_format: :date_long
14 post_thumbnail: true
15 post_thumbnail_default: images/thumbnail.png
16 post_thumbnail_placeholder: ""
17 terms:
18 paginate: 12
params.json
1{
2 "hb": {
3 "blog": {
4 "archives": {
5 "paginate": 30
6 },
7 "full_width": false,
8 "home": {
9 "featured_posts": 5,
10 "main_sections": [
11 "docs",
12 "blog"
13 ],
14 "taxonomies": true
15 },
16 "paginate": 12,
17 "post_date_format": ":date_long",
18 "post_thumbnail": true,
19 "post_thumbnail_default": "images/thumbnail.png",
20 "post_thumbnail_placeholder": ""
21 },
22 "terms": {
23 "paginate": 12
24 }
25 }
26}
Name | Type | Default | Description |
---|---|---|---|
comments | boolean | true | Whether to display comments. |
featured | boolean | false | Whether to display the post on homepage carousel. |
pinned | boolean | false | Whether to pin the post next to the carousel. |
The blog module ships with a built-in layout for archiving posts, which grouping posts by year and month. To archive posts, you need to generate the archives sections manually.
1---
2title: Archives
3---
Takes archives/2023/
as an example.
1---
2title: 2023
3---
Takes archives/2023/01/
as an example.
1---
2title: Jan
3---