-
Notifications
You must be signed in to change notification settings - Fork 80
/
post.ejs
106 lines (106 loc) · 6.13 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
<article itemscope itemtype="https://schema.org/Article">
<link itemprop="mainEntityOfPage" href="<%= page.permalink %>">
<div class="kratos-hentry kratos-page-inner clearfix">
<header class="kratos-page-header">
<% if (page.title) { %>
<h1 class="kratos-page-title text-center" itemprop="name headline"><%- page.title %></h1>
<% } %>
<ul class="kratos-page-meta text-center">
<li><time datetime="<%= date_xml(page.date) %>" itemprop="datePublished"><i class="fa fa-calendar"></i> <%- date(page.date, null) %></time></li>
<li itemprop="author" itemscope itemtype="https://schema.org/Person">
<i class="fa fa-user"></i> <%- __('post_meta.author') %> <span itemprop="name"><%- page.author || config.author %></span>
</li>
<% if (theme.posts.word_count.enable) { %>
<li>
<i class="fa fa-edit"></i>
<% const total_words = strip_html(page.content).length; %>
<% if (total_words < (theme.posts.word_count.threshold)) { %>
<%= total_words %>
<% } else { %>
<% if (theme.posts.word_count.estimate_wavy) { %>~<% } %><%= (total_words / 1000).toFixed(2) %>K
<% } %>
<%- __('post_meta.words') %>
</li>
<% } %>
<% if (theme.visit_count.enable_at.includes("post")) { %>
<li>
<i class="fa fa-eye"></i>
<%- __('post_meta.read_count', process_template_path(theme.visit_count.template._shared + theme.visit_count.template.post, url_for(page.path), "visit_count")) %>
</li>
<% } %>
<% if (page.comments && theme.comments.count.enable_at.includes("post")) { %>
<li>
<i class="fa fa-commenting-o"></i>
<%- __('post_meta.comments_count', process_template_path(theme.comments.count.template._shared + theme.comments.count.template.post, url_for(page.path), "comments")) %>
</li>
<% } %>
</ul>
</header>
<div class="kratos-page-content kr-post">
<% if (!!page.expire && !!page.title) { %>
<div id="expire-alert" class="alert alert-warning hidden" role="alert" data-after-days="<%- page.expire %>">
<div class="icon"><i class="fa fa-history"></i></div>
<div class="text"><p><%- __('last_update_alert', '<time datetime="' + page.updated + '"></time>') %></p></div>
</div>
<% } %>
<% const tocContent = toc(page.encrypt ? page.origin : page.content, { list_number: theme.posts.toc.mobile.list_number }); %>
<% if (theme.posts.toc.mobile.enable && page.toc && strip_html(tocContent)) { %>
<div class="kratos-post-inner-toc toc-div-class" <% if (page.encrypt) { %>style="display:none!important" <% } %>>
<%- tocContent %>
</div>
<% } %>
<hr />
<div itemprop="articleBody"><%- page.content %></div>
</div>
<% if (typeof page.show_copyright !== 'undefined' ? page.show_copyright : theme.copyright_notice.in_page.enable_at.includes("post")) { %>
<div class="kratos-copyright text-center clearfix">
<span itemprop="copyrightNotice"><%- theme.copyright_notice.in_page.template %></span>
</div>
<% } %>
<footer class="kratos-entry-footer clearfix">
<% const donateEnable = page.donate !== false && theme.posts.donate && theme.donate.enable; %>
<% const shareEnable = page.share !== false && theme.posts.share && theme.share.enable; %>
<% if (donateEnable || shareEnable) { %>
<div class="post-actions text-center clearfix" id="post-actions">
<% if (donateEnable) { %>
<a class="donate" href="javascript:;" onclick="krOpenDonateModal()"><i class="fa fa-bitcoin"></i> <%- __('post_action.donate') %></a>
<% } %>
<% if (shareEnable) { %>
<a class="share" href="javascript:;" onclick="krOpenShareModal()"><i class="fa fa-share-alt"></i> <%- __('post_action.share') %></a>
<% } %>
</div>
<% } %>
<div class="footer-tag clearfix">
<div class="pull-left">
<i class="fa fa-tags"></i>
<%- list_tags(page.tags, {
show_count: false,
style: 'none'
}) %>
</div>
<div class="pull-date">
<time datetime="<%= date_xml(page.updated) %>" itemprop="dateModified"><%- __('last_update') %><%- date(page.updated) %></time>
</div>
</div>
</footer>
</div>
<% if (page.prev || page.next) { %>
<nav class="navigation post-navigation clearfix" role="navigation">
<% if (page.next) { %>
<div class="nav-previous clearfix">
<a title=" <% if (page.next.title){ %><%= page.next.title %><% } else { %>(<%- __('no_title') %>)<% } %>" href="<%- config.root + page.next.path %>"><i class="fa fa-angle-left"></i> <%- __('post_next') %></a>
</div>
<% } %>
<% if (page.prev) { %>
<div class="nav-next clearfix">
<a title=" <% if (page.prev.title){ %><%= page.prev.title %><% } else { %>(<%- __('no_title') %>)<% } %>" href="<%- config.root + page.prev.path %>"><%- __('post_prev') %> <i class="fa fa-angle-right"></i></a>
</div>
<% } %>
</nav>
<% } %>
<% if (page.comments && theme.comments.core.enable_at.includes('post')) { %>
<div class="comment-post">
<%- process_template_path(theme.comments.core.template._shared + theme.comments.core.template.post, url_for(page.path), "comments") %>
</div>
<% } %>
</article>