halo
halo copied to clipboard
文章分类页面支持设置自定义模板。
你当前使用的版本
1.5.4
描述一下此特性
文章分类页面(/categories/{slug})支持设置和文章/自定义页面一样的自定义模板特性。
可参考方案:
- category 增加 template 字段用于保存模板名称。
- 主题支持添加如
category_foo.ftl
的模板文件。 - 渲染
/categories/{slug}
时判断当前分类是否有设置自定义模板。如果有,则按照对应模板渲染,否则渲染默认的category.ftl
。
具体使用案例可以参考官网的主题仓库和博客页面。如果支持此特性,只需要为不同的文章分类类型(主题、博客)设置不同的模板即可。
- https://halo.run/themes.html
- https://halo.run/blog.html
/kind feature /milestone 1.6.x
附加信息
No response
太好了,我刚想提这个需求的
@isFire 有兴趣参与实现一下吗?
@isFire 有兴趣参与实现一下吗?
哈哈哈,好啊,我先研究下,不过得等忙过这阵了
https://github.com/halo-dev/halo/issues/2569
/close
@ruibaby: Closing this issue.
In response to this:
https://github.com/halo-dev/halo/issues/2569
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.