我的hugo网站有以下目录结构:
content/
- posts/
- some_post.md
- talks
- some_talk.md
about.md
我想这个网站的main
菜单包括posts
和talks
的条目。目前我能够为about
添加一个菜单项,通过将menus = main
添加到前面的内容,但是,我希望posts
和talks
链接重定向到其内容的索引,而不是我直接维护的静态页面。这可能吗?
事实证明,这可以使用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