首页 文章

GitHub页面中工作的Jekyll永久链接列表

提问于
浏览
1

我目前正在开发一个Jekyll支持的站点,并且在我的Jekyll本地服务器中工作的 permalink: /:path/ 行不能通过 Configuration (_config.yml)或者在GitHub Pages中的每个页面(file.md)的 YAML Front Matter 中工作 . 它们实际上是作为example.com/:path/而不是example.com/dir-name/输出的 .

我已经尝试 permalink: "/:path/" 但仍然无法正常工作,some said that some permalink will not work in the Jekyll version of GitHub . 经过研究,GitHub Pages的Jekyll版本为2.4.0,可在its "Dependency versions" page中找到 . 在Jekyll网站的GitHub Pages documentation中也没有提到这一点 .

任何人都知道GitHub页面中工作Jekyll permalinks的确切列表,所以我可以选择在我的项目和未来的读者中使用什么固定链接?

1 回答

  • 2

    在jekyll 2.4中,您只需稍微配置页面的永久链接即可 .

    阅读 page.rb::template 代码这里是我们所拥有的:

    没有永久链接变量 - > /:path/:basename:output_ext

    永久链接var设置为 :pretty

    • index.html - > /:path/ (/folder/other/index.html - > / folder / other /)

    • other.html - > /:path/:basename/ (/folder/toto/other.html - > / folder / toto / other /)

    • code.js - > /:path/:basename:output_ext (/folder/code.js - > /folder/code.js)

    我相信jekyll 3将成为你在documentation中看到的所有内容的下一个github页面版本 .

相关问题