Skip to content
This repository has been archived by the owner on Oct 5, 2024. It is now read-only.

Commit

Permalink
Add gallery support
Browse files Browse the repository at this point in the history
  • Loading branch information
azigler committed Dec 28, 2017
1 parent c1b339e commit 30c0889
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion layout/_partial/article.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<% } %><% if (post.categories && post.categories.length){ %><%- partial('post/category') %>
</div><% } else { %> </div><% } %>
<div class="article-inner">
<div itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
<%- partial('post/gallery') %> <div itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
<meta itemprop="url" content="<%= theme.og_image_url %>">
</div>
<div class="article-entry" itemprop="articleBody">
Expand Down
3 changes: 2 additions & 1 deletion layout/_partial/post/date.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
</div><% } if (!(index) && !(page.archive)) { %>
<time datetime="<%= date_xml(post.date) %>" itemprop="datePublished" content="<%= date_xml(post.date) %>"><%= date(post.date, config.date_format) %></time>
<time datetime="<%= date_xml(post.date) %>"><%= date(post.date, config.time_format) %></time><span itemprop="dateModified" content="<%= date_xml(post.updated) %>>"</span>
</div><% } %>
</div>
<% } %>
8 changes: 8 additions & 0 deletions layout/_partial/post/gallery.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<% if (post.photos && post.photos.length){ %> <div class="article-gallery">
<div class="row article-gallery-photos">
<% post.photos.forEach(function(photo, i){ %> <a class="col-md-6 align-self-center article-entry" href="<%- url_for(photo) %>" rel="gallery_<%= post._id %>">
<img src="<%- url_for(photo) %>" itemprop="image" class="img-fluid">
</a><% }) %>
</div>
</div>
<% } %>

0 comments on commit 30c0889

Please sign in to comment.