簡體   English   中英

將分類法​​模板添加到Blogdown默認主題

[英]Add template for taxonomies to Blogdown default theme

我試圖將標簽和類別添加到默認的Blogdown主題(hugo-lithium主題)。

第一步,將config.toml配置為在主題的主菜單中包括Categories和Tags鏈接:

[[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)添加到主題中,以便按類別和標簽來細分博客文章列表?

作為記錄,這個問題已經交叉發布在Github上

hugo-lithium-theme沒有分類法的模板( terms.html ),因此不會生成索引頁面(例如, tags/index.html )。 如果您想添加它,我建議您花一些時間在Blogdown書中了解更多有關Hugo主題和模板的信息https : //bookdown.org/yihui/blogdown/templates.html ,並添加模板terms.html_default/文件夾。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM