博客模块为博客站点提供了基本的布局和模板。
| 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 | 是否全宽。 | 
blog.paginate | number | 9 | 每页博文数量。 | 
blog.post_date_format | string | :date_long | 博文日期格式。 | 
blog.post_thumbnail | boolean | true | 是否显示缩略图。 | 
blog.post_thumbnail_default | string | images/thumbnail.png | 相对于 assets 文件夹的默认缩略图。 | 
blog.post_thumbnail_placeholder | string | 站点标题 | 缩略图占位符。 | 
blog.archives | object | 归档设置。 | |
blog.archives.paginate | number | 30 | 归档每页博文数量。 | 
blog.home | object | 博客首页设置。 | |
blog.home.featured_posts | number | 10 | 特刊博文数量。 | 
blog.home.main_sections | array | - | 博文栏目,默认所有栏目。 | 
blog.home.taxonomies | boolean | true | 是否于首页显示分类统计。 | 
terms.paginate | number | 12 | 分类列表博文数量。 | 
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 | 是否显示评论。 | 
featured | boolean | false | 是否于首页幻灯片中显示该文章。 | 
pinned | boolean | false | 是否于首页置顶该文章。 | 
博客博客内置了文章归档布局,其可以按年份和月份进行归档。你需要手动创建栏目以归档文章。
1---
2title: Archives
3---
以 archives/2023/ 为例。
1---
2title: 2023
3---
以 archives/2023/01/ 为例。
1---
2title: Jan
3---