Jekyll集合在github.pages上不起作用
按照Jekyll文档中的说明,我在我的Jekyll博客中为开发人员相关的帖子创建了一个集合Jekyll集合在github.pages上不起作用,jekyll,github-pages,Jekyll,Github Pages,按照Jekyll文档中的说明,我在我的Jekyll博客中为开发人员相关的帖子创建了一个集合 collections: developer: output: true 在一个jekyll页面上,我尝试输出一个类似这样的帖子列表 <ul class="posts"> {% for post in site.developer %} <li> <span class="post-date">{{ post.da
collections:
developer:
output: true
在一个jekyll页面上,我尝试输出一个类似这样的帖子列表
<ul class="posts">
{% for post in site.developer %}
<li>
<span class="post-date">{{ post.date | date: "%b %-d, %Y" }}</span>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
<p>{{ post.excerpt }}</p>
</li>
{% endfor %}
</ul>
开发者帖子的列表可以在开发者页面的
http://localhost:4000/developer/
但是,该列表在github页面上不可见,我无法通过url访问帖子。博客在github页面上也可以正常工作,比如所有的站点,主页上的帖子都是可见的等等
注意,我确实将文件推送到github。我可以在回购协议中看到它们。我的第一个猜测是GitHub Pages仍在使用过时的Jekyll版本 GitHub pages的页面显示使用了Jekyll1.5.1。 但集合功能是由Jekyll2.0.0引入的,请参见JekyllHistory页面
如果是这种情况,那么您就无能为力,除非您将存储库托管在其他地方,或者将编译后的源代码推送到GitHub页面。我的第一个猜测是GitHub页面仍然使用过时的Jekyll版本 GitHub pages的页面显示使用了Jekyll1.5.1。 但集合功能是由Jekyll2.0.0引入的,请参见JekyllHistory页面
如果是这种情况,那么您就无能为力,除非您将存储库托管在其他地方,或者将编译后的源代码推送到GitHub页面。您不需要使用Collection为帖子或页面生成自定义列表 在你的前面加上:
---
...
flag: dev
---
带有标志==dev的页面列表示例
{% for page in pages %}
{% if page.flag == 'dev' %}
<li><a href="{{ site.baseurl }}{{ page.url }}">{{ page.title }}</a></li>
{% endif %}
{% endfor %}
您不需要使用集合来生成帖子或页面的自定义列表 在你的前面加上:
---
...
flag: dev
---
带有标志==dev的页面列表示例
{% for page in pages %}
{% if page.flag == 'dev' %}
<li><a href="{{ site.baseurl }}{{ page.url }}">{{ page.title }}</a></li>
{% endif %}
{% endfor %}
我们可以看到github回购协议吗?我们可以看到github回购协议吗?截至2014年8月21日,jekyll 2.2正在使用。这是否表示现在可以使用集合?@RyanTuck是。它现在正在我的Jekyll构建中使用。截至2014年8月21日,Jekyll 2.2正在使用。这是否表示现在可以使用集合?@RyanTuck是。它现在正在我的Jekyll构建中使用。但是你需要分页。但是你需要分页。