hexo-theme-ayer/layout/_partial/post/gallery.ejs
2019-12-03 19:37:44 +08:00

16 lines
523 B
Plaintext

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