Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jekyll 杰基尔没有建立或看到收藏_Jekyll - Fatal编程技术网

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 %}