-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharticle.ftl
212 lines (205 loc) · 12.7 KB
/
article.ftl
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<#--
Bolo - A stable and beautiful blogging system based in Solo.
Copyright (c) 2020, https://github.com/adlered
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<#-- Bolo - A stable and beautiful blogging system based in Solo. Copyright (c) 2020, https://github.com/adlered This
program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
for more details. You should have received a copy of the GNU Affero General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>. -->
<#-- Solo - A small and beautiful blogging system written in Java. Copyright (c) 2010-present, b3log.org This
program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
Public License as published by the Free Software Foundation, either version 3 of the License, or (at your
option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details. You should have received a copy of the GNU Affero General Public
License along with this program. If not, see <https://www.gnu.org/licenses/>. -->
<#include "../../common-template/macro-common_head.ftl">
<#include "macro-comments.ftl">
<#include "../../common-template/macro-comment_script.ftl">
<!DOCTYPE html>
<html>
<head>
<@head title="${article.articleTitle} - ${blogTitle}"
description="${article.articleAbstract?html}">
<link rel="stylesheet" href="https://www.zeekling.cn/cdn/css/bulma.min.css" />
<link rel="stylesheet" href="https://www.zeekling.cn/cdn/css/all.min.css">
<link rel="stylesheet" href="${staticServePath}/skins/${skinDirName}/css/base.css?${staticResourceVersion}" />
<link rel="stylesheet" href="${staticServePath}/skins/${skinDirName}/css/style.css?${staticResourceVersion}" />
<link rel="stylesheet" href="https://www.zeekling.cn/cdn/css/swiper.min.css">
<script src='https://www.zeekling.cn/cdn/js/swiper.min.js'></script>
</@head>
<style type="text/css">
.columns {
margin-left: 0.25rem;
margin-right: -0.75rem;
margin-top: -0.75rem;
}
</style>
<#-- <#include "style.theme.ftl"> -->
</head>
<body class="is-3-column">
<#include "header.ftl">
<script>
var loggedIn = ${article.logged};
</script>
<div class="card-normal">
<section class="section">
<div class="container">
<div class="columns">
<div class="column is-12-tablet is-8-desktop is-8-widescreen is-8-fullhd has-order-2 column-main">
<div class="card" style="display: block">
<div class="card-content article" id="card-content" style="width: 100%">
<h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
${article.articleTitle}
</h1>
<div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
<div class="level-left">
<!--<div class="level-item has-text-grey">
${article.articleUpdateDate?string("yyyy.MM.dd")}
</div>-->
<div class="level-item has-text-grey">
${article.articleCreateDate?string("yyyy.MM.dd")}
</div>
<div>浏览
<#assign viewCountStr=article.articleViewCount?string('#.###')/>
<#if viewCountStr?length gt 3>
<#assign viewCount=viewCountStr?number/>
<#assign viewCountK=viewCount/1000 />
${viewCountK?string('#.##')}K
<#else>
${article.articleViewCount}
</#if>
</div>
<div>
<#if article.articleCommentCount != 0>
评论 <a href="#comments">${article.articleCommentCount} </a>
</#if>
</div>
<div class="level-item has-text-grey">
分类: ${article.articleCategory}
</div>
</div>
</div>
<style>
.content .emoji {
width: 25px !important;
height: 25px !important;
}
</style>
<div id="post-article" class="content post-article" >
${article.articleContent}
</div>
<div class="level is-size-7 is-uppercase">
<div class="level-start">
<div class="level-item">
<span class="is-size-6 has-text-grey has-mr-7">#</span>
<#list article.articleTags?split(",") as articleTag>
<a class="has-link-grey -link"
href="${servePath}/tags/${articleTag?url('UTF-8')}">${articleTag!}</a>
</#list>
</div>
</div>
</div>
<#if "" !=article.articleSign.signHTML?trim>
<div>${article.articleSign.signHTML}</div>
</#if>
</div>
</div>
<div class="card">
<div class="card-content">
<h3 class="title is-5 has-text-weight-normal">评论</h3>
<@comments commentList=articleComments article=article
count=article.articleCommentCount>
</@comments>
</div>
</div>
</div>
<div class="column is-4-tablet is-3-desktop is-3-widescreen is-3-fullhd is-hidden-touch has-order-3 column-right <%= sticky_class(position) %>">
<#include "toc-post.ftl">
<div class="card widget">
<div class="card-content">
<article class="media">
<div class="media-content">
<div class="content">
<div class="item" id="randomArticles"></div>
</div>
</div>
</article>
</div>
</div>
<div class="card widget" id="r2">
<div class="card-content">
<article class="media">
<div class="media-content">
<div class="content" id="rArticles">
<div class="item" id="relevantArticles"></div>
</div>
</div>
</article>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<a id="back-to-top" title="返回顶部" href="javascript:"><i class="fas fa-chevron-up"></i></a>
<#include "footer.ftl">
<@comment_script oId=article.oId commentable=article.commentable>
<#if 0 !=randomArticlesDisplayCount>
page.loadRandomArticles('<h3>${randomArticlesLabel}</h3>');
</#if>
<#if 0 !=relevantArticlesDisplayCount>
page.loadRelevantArticles('${article.oId}','<h3>${relevantArticlesLabel}</h3>');
</#if>
Skin.initArticle()
</@comment_script>
<script>
// 延时检测右侧 “相关阅读” 是否为空,如果空则删除空 div,好看些
/**
$(function () {
var tempHtml =
'<a rel="nofollow" href="javascript:void(0)"><i class="fas fa-search fa-spin"></i> 努力寻找中 ...</a>';
$('#rArticles').append(tempHtml);
setTimeout(function () {
var judgeEmptyShowing = $('#rArticles').html();
judgeEmptyShowing = judgeEmptyShowing.replace(tempHtml, '');
$('#rArticles').html(judgeEmptyShowing);
judgeEmptyShowing = judgeEmptyShowing.replace(/[\r\n]/g,
"");
judgeEmptyShowing = judgeEmptyShowing.replace(new RegExp(
/( )/g), "");
if (judgeEmptyShowing === '') {
$('#rArticles').html(
'<a href="javascript:void(0)"><i class="fa fa-battery-empty"></i> 什么都没找到</a>'
);
setTimeout(function () {
$('#r2').fadeOut(1000);
}, 1000)
}
}, 3000)
})**/
$(document).ready(function(){
var content = $("#post-article");
var img_url = content.attr("data-img");
if (content.html().trim().startsWith('<p><a class="gallery-item" href="javascript:void(0)"><img')){
var img = content.find("p a").get(0);
img.remove();
}
})
</script>
</body>
</html>