您好,Tags的具体设置是什么样的?
WZChan opened this issue · comments
新手= =,不知道Tags到底怎么设置,老是在报错。
错误的输入输出如下
hugo -t hugo-nuo
Started building sites ...
ERROR 2017/12/05 10:49:25 Error while rendering "page": template:
executing "main" at <.Params.tags>: range can't iterate over caffe
我是在content底下直接生成tags.md
可以在本地页面上看到Tags标签,但是最后生成的时候就会出现上述错误。
所以希望能够了解到Tags的具体设置。
谢谢您。
不需要新增 tags.md 文件的,直接在 config.toml 菜单配置里增加一个 tags 的入口即可。
# Initial site menu, you can extend menu with content.
[[menu.main]]
name = "Home"
weight = 10
identifier = "home"
url = "/"
[[menu.main]]
name = "Works"
weight = 20
identifier = "works"
url = "https://github.com/laozhu"
[[menu.main]]
name = "Tags"
weight = 30
identifier = "tags"
url = "/tags/"
你可以通过修改权重来修改显示的顺序,其他的都可以不改的。
BTW,你的那种方式也可以增加菜单项的,主题里面的友链 (links) 页面和关于 (about) 页面是通过这种方式,适合需要用户自定义内容的页面,标签 (tags) 页面是自动生成的,所以不需要新建 tags.md 文件来配置自定义内容。
非常感谢,我弄好了。
问题在我在给文章分Tags的时候没有加方括号。
谢谢您。