-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcategory.html
63 lines (63 loc) · 2.39 KB
/
category.html
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
<div class="container" id="category">
{% for p in posts %}
{% if currentLoop.currentIndex == 0 %}
<div class="article huge">
<div class="featureimg" style="background-image: url('{% if p.ext_featureimg.length %}{{p.ext_featureimg}}{% else %}asset/defaultfeaimg.jpg{% /if %}')"></div>
<div class="row content">
<div class="col-md-2"></div>
<div class="col-md-10 main">
<div class="row">
<div class="col-md-10 post">
<div class="headline"><a href="{{ p.url }}">{{ p.title }}</a></div>
{% if p.ext_subtitle.length %}<div class="subtitle">{{p.ext_subtitle}}</div>{% /if %}
<div class="meta"><span class="time">$[timeformat('{{p.dateGTM}}')]</span></div>
<div class="body">
{{ p.desContent }}
</div>
<div class="bottom">
<a href="{{ p.url }}" class="continue float-right">
继续阅读
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="otherposts row">
{% else %}
<div class="col-md-6">
<a href="{{ p.url }}" class="item">
<div class="article normal">
<div class="featureimg" style="background-image: url('{% if p.ext_featureimg.length %}{{p.ext_featureimg}}{% else %}asset/defaultfeaimg.jpg{% /if %}')"></div>
<div class="articleinfo">
<div class="headline">{{ p.title }}</div>
{% if p.ext_subtitle.length %}<div class="subtitle">{{p.ext_subtitle}}</div>{% /if %}
</div>
</div>
</a>
</div>
{% /if %}
{% /for %}
</div>
<div class="pagenavi">
<div class="item">{% if prevPageUrl.length %}<a href="{{ prevPageUrl }}">更新文章</a>{% else %}已是最新一页{% /if %}</div>
<div class="item"> · </div>
<div class="item">{% if nextPageUrl.length %}<a href="{{ nextPageUrl }}">旧有文章</a>{% else %}已是最旧一页{% /if %}</div>
</div>
</div>
<script>
let category = new Vue({
el: '#category',
data: {},
methods: {
indexOddandEven(index) {
return index%2 ? 'odd' : 'even';
},
timeformat(raw) {
return moment(raw).format("YYYY 年 MM 月 DD 日");
}
},
delimiters: ['$[', ']']
})
</script>