【问题标题】:Add template for taxonomies to Blogdown default theme将分类模板添加到 Blogdown 默认主题
【发布时间】:2017-09-18 17:41:01
【问题描述】:

我试图为默认的 blogdown 主题(hugo-lithium 主题)添加标签和类别。

作为第一步,config.toml 被配置为在主题的主菜单中包含类别和标签链接:

[[menu.main]]
    name = "Categories"
    url = "/categories/"
    weight = 2
[[menu.main]]
    name = "Tags"
    url = "/tags/"
    weight = 3

单击类别链接显示:

Index of ./categories/ 
Name    Size    Date Modified 
./              2017-09-15 09:55:53 
../             2017-09-16 22:03:12 
r/              2017-09-15 09:55:53 
index.xml  695 B    2017-09-17 14:25:01 

点击标签链接显示:

Index of ./tags/
Name    Size    Date Modified
./              2017-09-15 15:31:46
../             2017-09-16 22:03:12
aws/            2017-09-15 15:31:46
openemr/        2017-09-15 15:31:46
plot/           2017-09-15 09:55:53
r-markdown/     2017-09-15 09:55:53
regression/     2017-09-15 09:55:53
index.xml  1,199 B  2017-09-17 14:36:01

寻求更好的用户体验来通过类别和标签来操纵沼泽。正如我在其他主题中看到的那样,我知道它存在。

我理解问题是分类模板(terms.html)不在主题中,因此不会生成索引页面(例如,tags/index.html)。

如何将分类模板 (terms.html) 添加到主题中,以便合理的用户按类别和标签对博客文章列表进行子集化?

【问题讨论】:

标签: r hugo blogdown


【解决方案1】:

为了记录,这个问题已被交叉发布on Github

hugo-lithium-theme 没有分类模板(terms.html),因此不会生成索引页面(例如,tags/index.html)。如果你想添加它,我建议你花一些时间在 blogdown 书中了解更多关于 Hugo 主题和模板的信息:https://bookdown.org/yihui/blogdown/templates.html,并将模板 terms.html 添加到 _default/文件夹。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-02-27
    • 2023-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多