blob: 9ea12614c9661d4563e9c9533398efe4739a0ca8 (
plain)
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
|
{{- define "content"}}
<main class="main" role="main">
<article class="content article article-archives article-type-list" itemscope="">
<header class="article-header">
<h1 itemprop="title">{{ .Title }}</h1>
<p class="text-muted">{{- T "total_article" (len .Pages) }}</p>
</header>
<div class="article-body">
{{ range $idx,$page := .Pages }}
{{ $thisYear := $page.Date.Format ("2006") }}
{{- $lastElement := $idx | add -1 | index $.RegularPages }}
{{- if or (eq $idx 0) ( ne ($lastElement.Date.Format "2006") $thisYear ) }}
<section class="panel panel-default b-no">
<div class="panel-heading" role="tab">
<h3 class="panel-title">
<a data-toggle="collapse" href="#collapse{{- $thisYear }}" aria-expanded="true">
<i class="icon icon-calendar-plus text-active"></i><i class="icon icon-calendar-minus text"></i>
{{- $thisYear }}
</a>
</h3>
</div>
<div id="collapse{{- $thisYear }}" class="panel-collapse collapse in" role="tabpanel"
aria-labelledby="heading{{- $thisYear }}">
<div class="panel-body">
<div class="collection">
{{- if ne $idx 0 }}
</div></div></div></section>
{{- end }}
{{- end }}
{{- .Scratch.Set "type" "link"}}
{{- partial "item-post.html" . }}
{{- end }}
</div>
</div></div></div></section>
</article>
</main>
{{- end }}
|