【问题标题】:collections pages loop not working on github收藏页面循环在 github 上不起作用
【发布时间】:2016-11-18 15:23:54
【问题描述】:
  • Jekyll 版本:2.4.0
  • github页面版本:35

我的复制步骤

  1. 在本地构建并循环显示集合site.collections.guides.docs,在_site 文件夹中生成正确的.html
  2. 但是,当我部署到 github 时,它不显示循环内容。

我想要的输出

在 github 页面中显示了循环,如果有人看看on my repo,将不胜感激。

我的代码:

// index.html
{% for doc in site.collections.guides.docs %}
  {{ doc.content }}
{% endfor %}

// _config.yml
collections :
  guides:
    output: true

【问题讨论】:

    标签: loops github collections jekyll github-pages


    【解决方案1】:

    我会这样写:

    {% for doc in site.guides %}
      {{ doc.content }}
    {% endfor %}
    

    配置如下:

    collections:
      guides:
        output: true
    

    【讨论】:

      猜你喜欢
      • 2017-03-28
      • 1970-01-01
      • 2014-04-20
      • 2019-01-30
      • 1970-01-01
      • 2020-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多