ghost后台tag页面可以展示pages文章
# 新增tags页面
点击Tags->New tag,依次填写Name->Slug
# 修改tag.hbs
执行vi /var/lib/ghost/content/themes/casper/tag.hbs
新增以下内容
{{#foreach posts}}
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
{{> "post-card"}}
{{/foreach}}
<!-- 新增的内容 -->
{{!-- .............................. --}}
{{#get "pages" filter="tag:{{tag.slug}}" limit="all"}}
{{#foreach pages}}
{{> "post-card"}} <!-- ...... post-card .................. -->
{{/foreach}}
{{/get}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
去掉这个提醒A collection of zero posts
删除以下代码
{{else}}
A collection of {{plural ../pagination.total empty='zero posts' singular='% post' plural='% posts'}}
1
2
2
# 将文章加到tags页面下
点击pages,右击文章选择Add a tag


上次更新: 2024/12/30, 14:46:54