use rendered banner and thumbnails where available (#23)

pull/194/head
Cian Butler 2016-10-13 10:22:12 +01:00 committed by GitHub
parent e9bc4943d0
commit 23fa083cbc
2 changed files with 7 additions and 6 deletions

View File

@ -1,14 +1,14 @@
<% if (post.link) { %>
<a href="<%- url_for(post.link) %>" target="_blank" itemprop="url">
<img src="<%- url_for(post.link) %><%- post.banner %>" class="article-banner" />
<img src="<%- url_for(post.link) %><%- 'banner-' + post.banner %>" class="article-banner" />
</a>
<% } else if (post.title) { %>
<% if (index) { %>
<a href="<%- url_for(post.path) %>" itemprop="url">
<img src="<%- url_for(post.path) %><%- post.banner %>" class="article-banner" />
<img src="<%- url_for(post.path) %><%- 'banner-' + post.banner %>" class="article-banner" />
</a>
<% } else { %>
<img src="<%- post.banner %>" class="article-banner" />
<img src="<%- 'banner-' + post.banner %>" class="article-banner" />
<% } %>
<% } %>

View File

@ -1,7 +1,8 @@
<a href="<%- url_for((post.link ? post.link : post.path)) %>" class="thumbnail">
<% var thumbnailUrl = thumbnail(post) %>
<% if (thumbnailUrl) { %>
<span style="background-image:url(<%- url_for(post.path) %><%= thumbnailUrl %>)" alt="<%= post.title %>" class="thumbnail-image"></span>
<% if (post.thumbnail) { %>
<span style="background-image:url(<%- url_for(post.path) %><%= 'thumb-' + post.thumbnail %>)" alt="<%= post.title %>" class="thumbnail-image"></span>
<% } else if (post.banner) { %>
<span style="background-image:url(<%- url_for(post.path) %><%= 'thumb-' + post.banner %>)" alt="<%= post.title %>" class="thumbnail-image"></span>
<% } else { %>
<span class="thumbnail-image thumbnail-none"></span>
<% } %>