2016-07-09 72 views
1

我是一個相對newkbe jekyll和液體。我前段時間運行了這個程序,但不知怎的,沒有備份就搞砸了。當發現錯誤只是轉移到其他地方...請看看。無法找到jekyll中的錯誤...「沒有找到預期的關鍵,而解析塊映射」

這裏是我的代碼:

--- 
title: Gallery 
layout: gallery 
heroimage: /img/hero-image-gallery.jpg 
imgsize: small 
masonry: 
itemsize: 33.333% 
categories: 
- Objects 
- People 
- Places 
images: 
- title: one 
    thumb: img/gallery-image-one.jpg 
    big: img/gallery-image-one.jpg 
    categories: 
    - People 
    - Places 
- title: two 
    thumb: img/gallery-image-two.jpg 
    big: img/gallery-image-two.jpg 
    categories: 
    - Objects 
    - Places 
- title: three 
    thumb: img/gallery-image-three.jpg 
    big: img/gallery-image-three.jpg 
    categories: 
    - People 
- title: four 
    thumb: img/gallery-image-four.jpg 
    big: img/gallery-image-four.jpg 
    categories: 
    - Objects 
    - Places 
- title: five 
    thumb: img/gallery-image-five.jpg 
    big: img/gallery-image-five.jpg 
    categories: 
    - Objects 
- title: eight 
    thumb: img/gallery-image-eight.jpg 
    big: img/gallery-image-eight.jpg 
    categories: 
    - Places 
- title: seven 
    thumb: img/gallery-image-seven.jpg 
    big: img/gallery-image-seven.jpg 
    categories: 
    - Places 
- title: six 
    thumb: img/gallery-image-six.jpg 
    big: img/gallery-image-six.jpg 
    categories: 
    - Objects 
    - People 
- title: bla 
    thumb: img/gallery-image-six.jpg 
    big: img/gallery-image-six.jpg 
    categories: 
    - Objects 
    - People 
--- 
<div class="portfolioFilter"> 

    <a href="#" data-filter="*" class="current">Alle</a> 
    {% for cat in page.categories %} 
     <a href="#" data-filter=".{{ cat | slugify }}">{{cat}}</a> 
    {% endfor %} 

</div><br> 
<div class="grid"> 
    <div class="grid-sizer"></div> 
    {% for item in page.images %} 
    <div class="grid-item{% for cat in item.categories %} {{cat | slugify}}{% endfor %}"> 
    <a class="example-image-link" href="{{item.big}}" data-lightbox="example-set" ><img src="{{item.thumb}}"/></a> 
    </div> 
    {% endfor %} 
</div> 

這裏是我得到的錯誤:

Error reading file /Users/maxborm/Desktop/lukawebsite/gallery.html: (<unknown>): did not find expected key while parsing a block mapping at line 2 column 1 

在此先感謝。

回答

2

縮進在Liquid中非常重要,在聲明集合時必須確保有足夠的空間。

對於您的情況,您在導致錯誤的- title: bla之前有額外的空間。

即你有:

- title: bla 

時,你應該有:

- title: bla 
相關問題