-
Notifications
You must be signed in to change notification settings - Fork 1
/
article-list.ftl
173 lines (155 loc) · 8.58 KB
/
article-list.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
<#--
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/>. -->
<div>
<#list articles as article>
<#if article.articlePutTop>
<div class="level">
<div class="blog-slider card">
<div class="blog-slider__wrp swiper-wrapper">
<div class="blog-slider__item swiper-slide">
<div class="blog-slider__img">
<a href="${article.articlePermalink}">
<img class="thumbnail" src="${adminUser.userAvatar!}" height="250" width="150"
data-src="${article.articleImg1URL}" alt="${article.articleTitle!}"
referrerpolicy="origin">
</a>
</div>
<div class="blog-slider__content">
<div>
<span class="blog-slider__code"
style="display:inline-block">${article.articleCreateDate?string("yyyy.MM.dd")}</span>
浏览
<#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>
<#if article.categoryURI??>
<h1 style="display:inline-block"><a class="has-link-black-ter"
href="/category/${article.categoryURI}">${article.articleCategory}</a></h1>
</#if>
</div>
<h2 class="blog-slider__title "><a class="title is-6"
href="${article.articlePermalink}">${article.articleTitle!}</a>
</h2>
<div class="blog-slider__text is-size-6" content="" >
<#if article.articleAbstractText!?length gt 48>
${article.articleAbstractText!?substring(0, 48)} <#else>
${article.articleAbstractText!}</#if>
</div>
<a href="${article.articlePermalink}"
class="button is-size-7 is-light">阅读更多</a>
</div>
</div>
</div>
<div class="blog-slider__pagination"></div>
</div>
</div>
<#else>
<div class="card">
<!--
<div class="card-image">
<a href="${article.articlePermalink}">
<img class="thumbnail" src="${adminUser.userAvatar!}" height="200" width="100"
data-src="${article.articleImg1URL}" alt="${article.articleTitle!}"
referrerpolicy="origin">
</a>
</div>
-->
<div class="card-content article " id="card-content" style="width: 100%">
<div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
<div class="level-left">
<time
class="level-item has-text-grey">${article.articleCreateDate?string("yyyy.MM.dd")}</time>
浏览
<#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>
<#if article.articleCategory != "">
<h1 style="display:inline-block"> <a class="has-link-black-ter"
href="/category/${article.categoryURI}">${article.articleCategory}</a></h1>
</#if>
</div>
</div>
<h2 class="title is-size-5 is-size-5-mobile has-text-weight-normal">
<a class="has-link-black-ter" href="${article.articlePermalink}">${article.articleTitle!}</a>
</h2>
<div id="is-hidden-touch" class="content is-hidden-touch is-size-6">
<#if article.articleAbstractText!?length gt 128>
${article.articleAbstractText!?substring(0, 110)} <#else>
${article.articleAbstractText!}</#if>
<#-- ${article.articleAbstractText!?substring(0, 110)} ...... -->
</div>
<div class="level is-mobile">
<div class="level-start">
<div class="level-item">
<a class="button is-size-7 is-light"
href="${article.articlePermalink}">阅读更多</a>
</div>
</div>
</div>
</div>
</div>
</#if>
</#list>
<div class="card card-transparent">
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
<#if paginationCurrentPageNum !=paginationFirstPageNum>
<div class="pagination-previous">
<a class="is-flex-grow has-text-black-ter"
href="${path}?p=${paginationPreviousPageNum}">上一页</a>
</div>
</#if>
<#if paginationCurrentPageNum !=paginationLastPageNum>
<div class="pagination-next">
<a class="is-flex-grow has-text-black-ter"
href="${path}?p=${paginationNextPageNum}">下一页</a>
</div>
</#if>
<ul class="pagination-list is-hidden-mobile">
<#list paginationPageNums as paginationPageNum>
<#if paginationPageNum==paginationCurrentPageNum>
<li><span class="pagination-link is-current">${paginationPageNum}</span></li>
<#else>
<li><a class="pagination-link"
href="${path}?p=${paginationPageNum}">${paginationPageNum}</a></li>
</#if>
</#list>
</ul>
</nav>
</div>
</div>
<style type="text/css">
.blog-slider__img {
margin-left: 20px;
width: 240px;
height: 150px;
}
</style>