Jekyll collections 只显示一些项目
Jekyll collections only show some items
我正在将一些项目从 posts
迁移到 jekyll 中的 collections
。
当它们是帖子时,所有项目都正确呈现。我将所有文件移动到 _items
目录并将以下内容添加到 _config.yml
collections:
items:
output: true
permalink: /things/:path/
然后我访问了页面中的 collection(标题在每个文件的 yaml front-mater 中)以使用以下方式进行调试:
{% for item in site.items %}
{{ item.title }}<br />
{% endfor %}
- 仅显示
_items
文件夹中的部分文件。
- 当我查看
_site
时,我在 items
文件夹中看到一些原始 .md
文件,在 things
文件夹中看到一些生成的页面。这些生成的文件与上面页面中显示的文件相匹配。
我试过以下方法:
- 查看编码以检查它不是带有 BOM 签名的 UTF-8
- 检查行尾是否一致 -
CRLF
- 查看文件名并 sub-folders
知道会发生什么吗?
更新
自 https://github.com/jekyll/jekyll/pull/4290 which will go live with version 3.1 - see which version Github Pages uses on https://pages.github.com/versions/
起已修复此问题
这似乎是因为在某些帖子的开头部分 ---
之后有空格。
的 Jekyll 问题跟踪器上创建了一个问题
查看该问题的演示
我正在将一些项目从 posts
迁移到 jekyll 中的 collections
。
当它们是帖子时,所有项目都正确呈现。我将所有文件移动到 _items
目录并将以下内容添加到 _config.yml
collections:
items:
output: true
permalink: /things/:path/
然后我访问了页面中的 collection(标题在每个文件的 yaml front-mater 中)以使用以下方式进行调试:
{% for item in site.items %}
{{ item.title }}<br />
{% endfor %}
- 仅显示
_items
文件夹中的部分文件。 - 当我查看
_site
时,我在items
文件夹中看到一些原始.md
文件,在things
文件夹中看到一些生成的页面。这些生成的文件与上面页面中显示的文件相匹配。
我试过以下方法:
- 查看编码以检查它不是带有 BOM 签名的 UTF-8
- 检查行尾是否一致 -
CRLF
- 查看文件名并 sub-folders
知道会发生什么吗?
更新
自 https://github.com/jekyll/jekyll/pull/4290 which will go live with version 3.1 - see which version Github Pages uses on https://pages.github.com/versions/
起已修复此问题这似乎是因为在某些帖子的开头部分 ---
之后有空格。