forked from shenliyang/hexo-theme-snippet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.ejs
65 lines (60 loc) · 2.26 KB
/
post.ejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<p id="process"></p>
<article class="post">
<div class="post-head">
<h1 id="<%= page.title %>">
<%if(page.link){%>
<a href="<%- url_for(page.link) %>" target="_blank"><%= page.title %></a>
<%}else{%>
<%= page.title||'NO Title!' %>
<%}%>
</h1>
<%- partial('_partial/article-meta', {post: page}) %>
<%
var diffDays = moment(new Date()).diff(moment(page.date), 'day');
var warningTextArr = theme.warning.text.split("%d");
%>
<% if((theme.warning.days!=0) && diffDays > (theme.warning.days || 300)){ %>
<p class="fa fa-exclamation-triangle warning">
<%- warningTextArr[0]%><strong><%= diffDays %></strong><%- warningTextArr[1]%>
</p>
<% } %>
</div>
<%- partial('_partial/gallery',{post:page})%>
<div class="post-body post-content">
<%- page.content %>
</div>
<% if(theme.reward.alipay || theme.reward.wepay){ %>
<%- partial('_partial/reward') %>
<% } %>
<div class="post-footer">
<div>
<% if(theme.declaration.enable){ %>
<%- theme.declaration.title %>:<%- theme.declaration.tip %><%- theme.cc %>
<% } %>
</div>
<div>
<% if(theme.cc){ %>
<%= __('post_licence') %>: <%- theme.cc %>
<% } %>
</div>
</div>
</article>
<div class="article-nav prev-next-wrap clearfix">
<% if(page.prev){ %>
<a href="<%- url_for(page.prev.path) %>" class="pre-post btn btn-default" title='<%- page.prev.title %>'>
<i class="fa fa-angle-left fa-fw"></i><span class="hidden-lg">上一篇</span>
<span class="hidden-xs"><%- page.prev.title %></span>
</a>
<% } %>
<% if(page.next){ %>
<a href="<%- url_for(page.next.path) %>" class="next-post btn btn-default" title='<%- page.next.title %>'>
<span class="hidden-lg">下一篇</span>
<span class="hidden-xs"><%- page.next.title %></span><i class="fa fa-angle-right fa-fw"></i>
</a>
<% } %>
</div>
<% if(page.comments){ %>
<div id="comments">
<%- partial('_vendor/comments/index', {page: page}) %>
</div>
<% } %>