user5927170
user5927170

Reputation:

Can this be a Bug in Jekyll? ('endfor' unknown tag)

just started using Jekyll today and Im having trouble... Here is my error message:

Unknown tag 'endfor' in _includes/masonry.html

I see no reason for the error. Please help me! Here is the code jekyll thinks is wrong:

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

Funny thing is that when I just take out the for loop im getting this:

Liquid syntax error: 'if' tag was never closed

Makes absolutely no sense to me... please help me!!!

Thanks in advance, Max

Upvotes: 1

Views: 1614

Answers (1)

Nils Landt
Nils Landt

Reputation: 3134

<a href="{% if item.image_small %}{{ item.image_small }}{{ endif }}" class="popup"><img src="{{ item.image }}" alt="" /></a>

should be

<a href="{% if item.image_small %}{{ item.image_small }}{% endif %}" class="popup"><img src="{{ item.image }}" alt="" /></a>

Upvotes: 3

Related Questions