forked from zchengsite/hexo-theme-oranges
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.ejs
169 lines (162 loc) · 6 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!-- 文章详情页,展示文章具体内容,url形式:https://yoursite/文章标题/ -->
<!-- 同时为「标签tag」,「朋友friend」,「分类categories」,「关于about」页面的承载页面,具体展示取决于page.type -->
<% if (theme.mathjax && theme.mathjax.enable){ %>
<%- partial('_partial/mathjax') %>
<% } %>
<% if (theme.codeBlock && theme.codeBlock.copy && theme.codeBlock.copy.enable){ %>
<%- partial('_partial/clipboard') %>
<% } %>
<% if (page.type === "tags") { %>
<!-- 标签页 url形式:https://yoursite/tags/ -->
<div class="container tag-index">
<div>
<%- list_tags({ class: "tag" }) %>
</div>
</div>
<% } %>
<% if (page.type === "categories") { %>
<!-- 分类页 url形式:https://yoursite/categories/ -->
<div class="container category-index">
<div>
<%- list_categories({orderby: "length", order: -1}) %>
</div>
</div>
<% } %>
<% if (page.type === "friends") { %>
<!-- 朋友页 url形式:https://yoursite/friends/ -->
<div class="container friend-index">
<div class="friend-list">
<% for(let friend of theme.friends) { %>
<div class="friend-list-item">
<span class="nickname">@ <%- friend.nickname %></span>
<a href="<%- friend.site %>" target="_blank">
<span class="site-path"><%- friend.site %></span>
</a>
<p class="card-meta">
<%- friend.meta %>
</p>
</div>
<% } %>
</div>
<div class="markdown-body">
<%- page.content %>
</div>
</div>
<% } %>
<% if(page.type === "about") { %>
<!-- 关于页 url形式:https://yoursite/about/ -->
<div class="container about-index">
<div class="markdown-body">
<%- page.content %>
</div>
</div>
<% } %>
<% if (!page.type) { %>
<!-- 文章内容页 url形式:https://yoursite/文章标题/ -->
<div class="container post-details" id="post-details">
<div class="post-content">
<div class="post-title"><%- page.title %></div>
<div class="post-attach">
<span class="post-pubtime">
<i class="iconfont icon-updatetime mr-10" title="<%= __('updateTime') %>"></i>
<%- page.updated.format("YYYY-MM-DD HH:mm:ss") %>
</span>
<% for(item of theme.navbar) {
if (item.key === 'tags' && item.enable) {
if(page.tags && page.tags.length > 0) { %>
<span class="post-tags">
<i class="iconfont icon-tags mr-10" title="<%= __('tags') %>"></i>
<% for(let item of page.tags.data) { %>
<span class="span--tag mr-8">
<a href="<%= url_for(item.path)%>" title="<%- item.name %>">
#<%- item.name %>
</a>
</span>
<% } %>
</span>
<% }
}
if (item.key === 'categories' && item.enable) {
if(page.tags && page.categories.length > 0) { %>
<span class="post-categories">
<i class="iconfont icon-bookmark" title="<%= __('categories') %>"></i>
<% for(let item of page.categories.data){ %>
<span class="span--category">
<a href="<%= url_for(item.path)%>" title="<%- item.name %>">
<b>#</b> <%- item.name %>
</a>
</span>
<% } %>
</span>
<% }
}
} %>
</div>
<div class="markdown-body">
<%- page.content %>
</div>
<% if(theme.prevnext.enable) { %>
<div class="prev-or-next">
<div class="post-foot-next">
<% if(page.next) { %>
<a href="<%- url_for(page.next.path) %>" target="_self">
<i class="iconfont icon-chevronleft"></i>
<span><%= __('prev') %></span>
</a>
<% } %>
</div>
<div class="post-attach">
<span class="post-pubtime">
<i class="iconfont icon-updatetime mr-10" title="<%= __('updateTime') %>"></i>
<%- page.updated.format("YYYY-MM-DD HH:mm:ss") %>
</span>
<% for(item of theme.navbar) {
if (item.key === 'tags' && item.enable) {
if(page.tags && page.tags.length > 0) { %>
<span class="post-tags">
<i class="iconfont icon-tags mr-10" title="<%= __('tags') %>"></i>
<% for(let item of page.tags.data) { %>
<span class="span--tag mr-8">
<a href="<%= url_for(item.path)%>" title="<%- item.name %>">
#<%- item.name %>
</a>
</span>
<% } %>
</span>
<% }
}
if (item.key === 'categories' && item.enable) {
if(page.tags && page.categories.length > 0) { %>
<span class="post-categories">
<i class="iconfont icon-bookmark" title="<%= __('categories') %>"></i>
<% for(let item of page.categories.data){ %>
<span class="span--category">
<a href="<%= url_for(item.path)%>" title="<%- item.name %>">
<b>#</b> <%- item.name %>
</a>
</span>
<% } %>
</span>
<% }
}
} %>
</div>
<div class="post-foot-prev">
<% if(page.prev) { %>
<a href="<%- url_for(page.prev.path) %>" target="_self">
<span><%= __('next') %></span>
<i class="iconfont icon-chevronright"></i>
</a>
<% } %>
</div>
</div>
<% } %>
</div>
<%- partial("_partial/catalog") %>
<% if(theme.comments.enable) { %>
<div class="comments-container">
<%- partial("_partial/comments") %>
</div>
<% } %>
</div>
<% } %>