hugo-theme-stack
hugo-theme-stack copied to clipboard
分类页面添加到菜单中显示空
What happened?
我想把分类页面添加到菜单中,就是在菜单中点击分类,跳转到a.com/categories这个链接,显示所有的分类合集,我尝试这样写,但是显示的是空
--- title: "分类" layout: "single" slug: "categories" url: "/categories" menu: main: weight: -60 params: icon: categories ---
同样的标签页面这样写就可以显示所有的标签合集
--- title: "标签" layout: "single" slug: "tags" url: "/tags" menu: main: weight: -60 params: icon: tag ---
Hugo version
0.145.0
Theme version
3.30.0
What browsers are you seeing the problem on?
Chrome
More information about the browser
No response
Relevant log output
Link to Minimal Reproducible Example
https://github.com/CaiJimmy/hugo-theme-stack
Hugo 本来就自带了 /categories 这个页面(https://demo.stack.jimmycai.com/categories),你再创建一个 categories 页面有可能导致冲突所以才不显示。
正确方法是在设置文件里面直接添加一个菜单项,参考:https://github.com/CaiJimmy/hugo-theme-stack-starter/blob/77fe570b3a58053d94127488cb34b2adf65d0273/config/_default/menu.toml#L1