ruby - 这可能是 Jekyll 中的错误吗? ('endfor' 未知标签)

标签 ruby jekyll liquid

今天刚开始使用 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

对我来说完全没有意义......请帮助我!!!

提前致谢, 最大

最佳答案

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

关于ruby - 这可能是 Jekyll 中的错误吗? ('endfor' 未知标签),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35398409/

相关文章:

html - Jekyll 检测带有 yaml 前端内容的 sass 文件作为页面

jquery - 当数量最大值为 0 时隐藏添加到购物车按钮 (Shopify)

javascript - Jekyll:JavaScript 中的液体标签

ruby - 我在 ruby​​ 1.8 应用程序中使用 ftools,如何使其与 ruby​​ 1.9 兼容

Ruby Soap4R Web 服务、.NET 消费者

ruby - 如何在 Rspec 中使用通配符参数模拟方法调用?

json - 如何在液体文件级别访问 shopify 中的自定义 JSON 文件

ruby - 迭代时删除数组元素

github - Jekyll 中的类别和标签有什么区别?

wordpress - 使用 Kramdown 的代码块,在 Liquid 中修改