【问题标题】:Jekyll not building or seeing collectionJekyll 没有建立或查看收藏
【发布时间】:2017-03-27 07:33:32
【问题描述】:

我似乎无法让 Jekyll 识别出集合的存在!

我的文件夹结构是这样的

_posts
_includes
_layouts
_sass
_site
_portfolio
assets
index.html

_portfolio 是集合

我的 _config.yml 文件中有它

colletions:
  portfolio:
    output: true

我正在尝试在此处的列表中显示它(这个 sn-p 来自我在 index.html 中使用的默认布局)

{% for item in site.portfolio %}
        <a href="{{ item.url | relative_url }}" class="portfolio-item-link"> 
            <div class="portfolio-item" style="background: url('{{ site.url }}/assets/img/{{ item.image }}'); background-size: cover; background-position: center;">
                <h1 class="portfolio-item-title">{{ item.title }}</h1>
            </div>
        </a>
{% endfor %}

问题是 Jekyll 甚至没有向集合中添加任何东西!如果我这样做{{ site.portfolio | inspect }} 它返回零。我还尝试在我的 Ubuntu 系统上生成该站点(我当前的系统是 windows)。如果有人有任何想法,我将不胜感激!

【问题讨论】:

    标签: jekyll


    【解决方案1】:

    所以我在 _config.yml 文件中拼错了“集合”。不要那样做。现在可以了。

    【讨论】:

      猜你喜欢
      • 2021-11-17
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多