Jekyll 默认情况下如何编译为命名文件?
我从Jekyll开始,并提到了生成Jekyll 默认情况下如何编译为命名文件?,jekyll,Jekyll,我从Jekyll开始,并提到了生成 命名的HTML文件(http://example.com/about.html) 或者目录和index.html(http://example.com/about/index.html) 使用默认设置重新安装的Jekyll会将about.md文件编译为http://example.com/about/index.html 如何更改默认行为以生成命名HTML文件?试试。页面的默认值是/:path/:basename,正如您所注意到的,这将导致目录和index
- 命名的HTML文件(
)http://example.com/about.html
- 或者目录和index.html(
)http://example.com/about/index.html
about.md
文件编译为http://example.com/about/index.html
如何更改默认行为以生成命名HTML文件?试试。页面的默认值是/:path/:basename
,正如您所注意到的,这将导致目录和index.html。在about.md
的YAML前端,您可以添加:
permalink: /:path/about.html
或者,您可以在\u config.yml
中修改配置,以更改所有页面的行为:
permalink: /:path/:basename.html
非常感谢。我尝试了全局解决方案,但在重新启动jekyll时出现了一个
jekyll 3.2.1 |错误:未定义#
的方法“basename”。在尝试about.md
的特定解决方案时,我意识到默认情况下有一个permalink条目。我删除了它,得到了“命名HTML”行为(默认情况下)。添加permalink://:path/about.html
也有效。