今天刚刚开始使用Jekyll,我遇到了麻烦......这是我的错误信息:
Unknown tag 'endfor' in _includes/masonry.html
我认为没有理由错误。请帮我! 以下是jekyll认为错误的代码:
<div class="gallery masonry-gallery no-margin">
{% for item in page.slideshow %}
<figure class="gallery-item">
<header class='gallery-icon'>
<a href="{% if item.image_small %}{{ item.image_small }}{{ endif }}" class="popup"><img src="{{ item.image }}" alt="" /></a>
</header>
<figcaption class='gallery-caption'>
<div class="entry-summary">
<h3>{% if item.caption %}{{ item.caption }}{% endif %}</h3>
<p>{% if item.description %}{{ item.description }}{% endif %}</p>
</div>
</figcaption>
</figure>
{% endfor %}
有趣的是,当我刚拿出for循环时,我得到了这个:
Liquid syntax error: 'if' tag was never closed
对我来说绝对没有意义......请帮助我!!!
提前致谢, 最大
答案 0 :(得分:3)
<a href="{% if item.image_small %}{{ item.image_small }}{{ endif }}" class="popup"><img src="{{ item.image }}" alt="" /></a>
应该是
<a href="{% if item.image_small %}{{ item.image_small }}{% endif %}" class="popup"><img src="{{ item.image }}" alt="" /></a>