Jekyll 杰基尔没有建立或看到收藏
我似乎无法让杰基尔意识到收藏的存在 我的文件夹结构是这样的Jekyll 杰基尔没有建立或看到收藏,jekyll,Jekyll,我似乎无法让杰基尔意识到收藏的存在 我的文件夹结构是这样的 _posts _includes _layouts _sass _site _portfolio assets index.html _公文包是收藏 我在我的_config.yml文件中也有它 colletions: portfolio: output: true 我试图在这里的列表中显示它(这个片段来自我的默认布局,在我的index.html中使用) {%用于site.portfolio%中的项目] {%endfor%
_posts
_includes
_layouts
_sass
_site
_portfolio
assets
index.html
_公文包是收藏
我在我的_config.yml文件中也有它
colletions:
portfolio:
output: true
我试图在这里的列表中显示它(这个片段来自我的默认布局,在我的index.html中使用)
{%用于site.portfolio%中的项目]
{%endfor%}
问题是杰基尔甚至没有在收藏中添加任何东西!如果我执行{{site.portfolio | inspect}}
则返回nil。我还尝试在我的Ubuntu系统上生成该站点(我当前的系统是windows)。如果有人有任何想法,我会非常感激 所以我在我的_config.yml文件中拼错了“collections”。不要那样做。现在可以了
{% 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 %}