在 Jekyll 中使用 slug.html 而不是 slug/index.html 构建页面(难看的 URL)

Build pages with slug.html rather than slug/index.html in Jekyll (ugly URLs)

我有一个带有 slug about-us 的页面。默认情况下,Jekyll 构建这个:

/about-us
         /index.html

但是,我想要这个:

/about-us.html

通读 Permalinks 文档,看起来我可以在配置中使用它

permalink: /:slug:output_ext

但是,这会产生与上面相同的输出。

我如何配置 Jekyll 将页面写成自己的 .html 页面,而不是放在带有 index.html?

的文件夹中

Jekyll 只会生成 /about-us/index.html 如果您在 页面的首页 中有 permalink: /about-us/ 或者如果您在 permalink: pretty 中有 permalink: pretty =18=]配置文件.

确保以上两种情况都不会产生/about-us.html