我的hugo网站具有以下目录结构:
content/
- posts/
- some_post.md
- talks
- some_talk.md
about.md
我希望该站点的main
菜单包含posts
和talks
的条目。目前,我可以通过在前面添加about
来为menus = main
添加菜单项,但是,我希望posts
和talks
链接重定向到索引内容,而不是我直接维护的静态页面。这可能吗?
答案 0 :(得分:0)
事实证明,使用menu
中的config.toml
配置可以做到这一点。 weight
属性用于订购菜单:
[menu]
[[menu.main]]
identifier = "home"
name = "home"
url = "/"
weight = 10
[[menu.main]]
identifier = "blog"
name = "blog"
url = "/post/"
weight = 20
[[menu.main]]
identifier = "talks"
name = "talks"
url = "/talks/"
weight = 30
[[menu.main]]
identifier = "about me"
name = "about me"
url = "/about/"
weight = 40