Become a backer or sponsor to support our work.
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.list_cols_md | number | 2 | The number of posts per list row on md breakpoint. |
blog.list_cols_lg | number | 3 | The number of posts per list row on lg breakpoint. |
blog.paginate | number | 9 | How many posts per list page. |
blog.post_date_format | string | :date_long | The date format. |
blog.post_read_more | boolean | true | Whether to show the read more button. |
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_height | string | 160px | The height thumbnails. |
blog.post_thumbnail_placeholder | string | Site’s title | The thumbnail placeholder. |
blog.post_thumbnail_position | string | top | The position of thumbnail, start or top . |
blog.post_thumbnail_resize_height | string | 360 | The height for resizing thumbnails. |
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.pinned_posts_position | string | Next to carousel | The position of pinned posts, available options: list . |
blog.home.taxonomies | boolean | true | Whether to show the taxonomies stat on home page. |
blog.toc.position | string | end | start : on the left of content, end : on the right of content, content : above the content. |
blog.list_style | string | - | Empty, minimalist , cascade . |
terms.list_style | string | - | Empty, minimalist , cascade . |
terms.paginate | number | 12 | The number of posts per term list page. |
terms.profile | boolean | true | When false , hide the profile. |
terms.profile_metrics | boolean | true | When false , hide the profile’s metrics. |
params.toml
1[hb]
2 [hb.blog]
3 full_width = false
4 list_cols_lg = 3
5 list_cols_md = 2
6 list_style = ''
7 paginate = 12
8 post_date_format = ':date_long'
9 post_thumbnail = true
10 post_thumbnail_default = 'images/thumbnail.png'
11 post_thumbnail_placeholder = ''
12 post_thumbnail_position = 'top'
13 [hb.blog.archives]
14 paginate = 30
15 [hb.blog.home]
16 featured_posts = 5
17 main_sections = ['docs', 'blog']
18 taxonomies = true
19 [hb.blog.toc]
20 position = 'end'
21 [hb.terms]
22 list_style = ''
23 paginate = 12
24 profile = true
25 profile_metrics = true
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 list_cols_lg: 3
13 list_cols_md: 2
14 list_style: ""
15 paginate: 12
16 post_date_format: :date_long
17 post_thumbnail: true
18 post_thumbnail_default: images/thumbnail.png
19 post_thumbnail_placeholder: ""
20 post_thumbnail_position: top
21 toc:
22 position: end
23 terms:
24 list_style: ""
25 paginate: 12
26 profile: true
27 profile_metrics: true
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 "list_cols_lg": 3,
17 "list_cols_md": 2,
18 "list_style": "",
19 "paginate": 12,
20 "post_date_format": ":date_long",
21 "post_thumbnail": true,
22 "post_thumbnail_default": "images/thumbnail.png",
23 "post_thumbnail_placeholder": "",
24 "post_thumbnail_position": "top",
25 "toc": {
26 "position": "end"
27 }
28 },
29 "terms": {
30 "list_style": "",
31 "paginate": 12,
32 "profile": true,
33 "profile_metrics": true
34 }
35 }
36}
Name | Type | Default | Description |
---|---|---|---|
comments | boolean | true | Whether to display comments. |
external_url | string | - | External post URL. |
featured | boolean | false | Whether to display the post on homepage carousel. |
pinned | boolean | false | Whether to pin the post next to the carousel. |
toc | boolean | true | Whether to show the ToC (Table of Contents). |
meta | boolean/object | true | When false then disable all meta. |
meta.authors | boolean | true | When false then disable the authors meta. |
meta.date | boolean | true | When false then disable the date meta. |
meta.reading_time | boolean | true | When false then disable the reading time meta. |
meta.taxonomies | boolean | true | When false then disable the taxonimies meta: series, categories and tags. |
meta.first_section | boolean | true | Whether to display the first section of page. |
sidebar | boolean | true | Whether to display the sidebar. |
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---