🚀 fix: albums display

This commit is contained in:
沈宇
2020-03-16 11:24:54 +08:00
parent 68b1022367
commit a9473d4d22
7 changed files with 24 additions and 48 deletions

View File

@@ -1,18 +1,17 @@
<% if (post.albums && post.albums.length){ %>
<div class="article-albums">
<ul class="article-albums-photos" id="basicExample">
<% post.albums.forEach(function(photo){ %>
<div class="article-albums">
<ul class="article-albums-photos" id="basicExample">
<% post.albums.forEach(function(photo){ %>
<li class="article-albums-item" data-scroll-reveal>
<a class="article-albums-img fancybox" data-fancybox="images" data-caption="<%- photo[1] %>" href="<%- url_for(photo[0]) %>" rel="gallery_<%= post._id %>" title="<%- photo[1] %>">
<img class="lazy" data-original="<%- url_for(photo[0]) %>" itemprop="image" alt="<%- photo[1] %>">
</a>
<% if (photo && photo.length > 1){ %>
<span class="article-albums-caption"> <%- photo[1] %> </span>
<% } %>
</li>
<li class="article-albums-item" data-scroll-reveal>
<img class="lazy" data-original="<%- url_for(photo[0]) %>" itemprop="image" alt="<%- photo[1] %>"
style="cursor: pointer;">
<% if (photo && photo.length > 1){ %>
<span class="article-albums-caption"> <%- photo[1] %> </span>
<% } %>
</li>
<% }) %>
</ul>
</div>
<% } %>
<% }) %>
</ul>
</div>
<% } %>

View File

@@ -1,12 +1,9 @@
<% if (post.albums && post.albums.length){ %>
<div class="justified-gallery" id="gallery">
<div class="justified-gallery" id="gallery">
<% post.albums.forEach(function(photo){ %>
<div>
<a class="fancybox" data-fancybox="images" data-caption="<%- photo[1] %>" href="<%- url_for(photo[0]) %>" rel="gallery_<%= post._id %>" title="<%- photo[1] %>">
<img src="<%- url_for(photo[0]) %>" itemprop="image" alt="<%- photo[1] %>">
</a>
</div>
<% }) %>
<div>
<img src="<%- url_for(photo[0]) %>" itemprop="image" alt="<%- photo[1] %>" style="cursor: pointer;">
</div>
<% } %>
<% }) %>
</div>
<% } %>