Hugo:如何将 list.html 页面重定向到 single.html 页面

Hugo: How to redirect a list.html page to a single.html page

假设您的网站 URL 是 http://example.com and you have a section called updates, so http://example.com/updates/update1, http://example.com/updates/update2

content/updates/update1.md

content/updates/update2.md

如果您访问 http://example.com/updates/,您会得到一个空白页面。

Hugo 是否提供了一种将部分重定向到单个页面的方法,以便 http://example.com/updates -> http://example.com/updates/update1/ ?

使用别名:http://gohugo.io/content-management/urls#aliases

在content/updates/update1.md:

+++

aliases = [
    "/updates/"
]

+++