halo icon indicating copy to clipboard operation
halo copied to clipboard

文章分类页面支持设置自定义模板。

Open ruibaby opened this issue 2 years ago • 3 comments

你当前使用的版本

1.5.4

描述一下此特性

文章分类页面(/categories/{slug})支持设置和文章/自定义页面一样的自定义模板特性。

可参考方案:

  1. category 增加 template 字段用于保存模板名称。
  2. 主题支持添加如 category_foo.ftl 的模板文件。
  3. 渲染 /categories/{slug} 时判断当前分类是否有设置自定义模板。如果有,则按照对应模板渲染,否则渲染默认的 category.ftl

具体使用案例可以参考官网的主题仓库和博客页面。如果支持此特性,只需要为不同的文章分类类型(主题、博客)设置不同的模板即可。

  • https://halo.run/themes.html
  • https://halo.run/blog.html

/kind feature /milestone 1.6.x

附加信息

No response

ruibaby avatar Jul 09 '22 14:07 ruibaby

太好了,我刚想提这个需求的

isFire avatar Jul 18 '22 02:07 isFire

@isFire 有兴趣参与实现一下吗?

ruibaby avatar Jul 18 '22 04:07 ruibaby

@isFire 有兴趣参与实现一下吗?

哈哈哈,好啊,我先研究下,不过得等忙过这阵了

isFire avatar Jul 18 '22 09:07 isFire

https://github.com/halo-dev/halo/issues/2569

/close

ruibaby avatar Oct 25 '22 03:10 ruibaby

@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.

f2c-ci-robot[bot] avatar Oct 25 '22 03:10 f2c-ci-robot[bot]