默认情况下如何编译为命名文件?
How to compile to named files by default?
我从 Jekyll 开始,the docs 提到生成的可能性
- 任一名为 HTML 的文件 (
http://example.com/about.html
)
- 或目录和 index.html 个目录 (
http://example.com/about/index.html
)。
使用默认设置全新安装 Jekyll 会将 about.md
文件编译为 http://example.com/about/index.html
。
如何更改生成命名 HTML 文件的默认行为?
尝试permalinks。页面的默认值是 /:path/:basename
,如您所见,它指向目录和 index.html。在about.md
的YAML Front Matter中,可以添加:
permalink: /:path/about.html
或者,您可以修改 _config.yml
中的配置以更改所有页面的行为:
permalink: /:path/:basename.html
我从 Jekyll 开始,the docs 提到生成的可能性
- 任一名为 HTML 的文件 (
http://example.com/about.html
) - 或目录和 index.html 个目录 (
http://example.com/about/index.html
)。
使用默认设置全新安装 Jekyll 会将 about.md
文件编译为 http://example.com/about/index.html
。
如何更改生成命名 HTML 文件的默认行为?
尝试permalinks。页面的默认值是 /:path/:basename
,如您所见,它指向目录和 index.html。在about.md
的YAML Front Matter中,可以添加:
permalink: /:path/about.html
或者,您可以修改 _config.yml
中的配置以更改所有页面的行为:
permalink: /:path/:basename.html