git文章

This commit is contained in:
结发受长生
2018-05-06 12:18:58 +08:00
parent 2e536826e2
commit fc3bc198b9
27 changed files with 1097 additions and 4 deletions
@@ -38,7 +38,16 @@
</div>
<div class="post-thumbnail" data-img="<%- post.photos[0] %>">
<a href="<%= post.permalink %>" title="<%= post.title %>">
<% if (post.thumbnail) { %>
<%
var numSum = 0
let dateNum = parseInt(date(post.date, 'YYYYMMDDHHmmss'))
let mutipart = 10
while(dateNum % mutipart != dateNum) {
numSum += Math.floor(dateNum % mutipart / (mutipart/10))
mutipart *= 10
}
if (post.thumbnail) {
%>
<!--
<%- image_tag(post.thumbnail, { class: "thumbnail" }) %>
-->
@@ -46,9 +55,9 @@
<% } else if (post.photos.length) { %>
<img class="thumbnail" src="<%- url_for('img/loading2.gif') %>" data-echo="<%= url_for(post.photos[0]) %>" alt="<%= post.title %>" >
<% } else if (theme.CDN) { %>
<img class="thumbnail" src="<%- url_for('img/loading2.gif') %>" data-echo="<%- url_for(theme.CDN + 'thumbnail/' + date(post.date, 'YYYY-MM-DD').charAt(date(post.date, 'YYYY-MM-DD').length - 1) + '.jpg') %>" alt="默认配图" >
<img class="thumbnail" src="<%- url_for('img/loading2.gif') %>" data-echo="<%- url_for(theme.CDN + 'thumbnail/' + numSum%10 + '.jpg') %>" alt="默认配图" >
<% } else { %>
<img class="thumbnail" src="<%- url_for('img/loading2.gif') %>" data-echo="<%- url_for('img/thumbnail/' + date(post.date, 'YYYY-MM-DD').charAt(date(post.date, 'YYYY-MM-DD').length - 1) + '.jpg') %>" alt="默认配图" >
<img class="thumbnail" src="<%- url_for('img/loading2.gif') %>" data-echo="<%- url_for('img/thumbnail/' + numSum%10 + '.jpg') %>" alt="默认配图" >
<% } %>
</a>
</div>