【问题标题】:List of the working Jekyll permalinks in GitHub PagesGitHub Pages 中可用的 Jekyll 永久链接列表
【发布时间】:2016-01-15 12:25:48
【问题描述】:

我目前正在开发一个由 Jekyll 提供支持的站点,并且在我的 Jekyll 本地服务器中运行的行 permalink: /:path/ 无法通过 配置 (_config.yml) 或 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 有一个 2.4.0 的 Jekyll 版本,可以在 its "Dependency versions" page 找到。 Jekyll 网站的GitHub Pages documentation 中也没有提及这一点。

有人知道 GitHub Pages 中有效的 Jekyll permalinks 的确切列表,所以我可以选择在我的项目中使用哪些永久链接以及供未来的读者使用?

【问题讨论】:

    标签: github configuration jekyll permalinks github-pages


    【解决方案1】:

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

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

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

    永久链接变量设置为: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 将成为下一个 github 页面版本,其中包含您在 documentation 中看到的所有内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-15
      • 1970-01-01
      • 1970-01-01
      • 2023-01-01
      相关资源
      最近更新 更多