<% if (post.photos && post.photos.length) { %>
<div class="article-gallery">
    <% post.photos.forEach(function(photo, i) { %>
    <a class="gallery-item" href="<%- url_for(photo) %>" rel="gallery_<%= post._id %>">
        <img src="<%- url_for(photo) %>" itemprop="image" />
    </a>
    <% }) %>
</div>
<% } %>