Welcome to mirror list, hosted at ThFree Co, Russian Federation.

list.html « _default « layouts - github.com/xiaoheiAh/hugo-theme-pure.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a318be3dc735a8473aca7525eb6ca76b5b18b0ba (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
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
{{- 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 .Site.RegularPages) }}</p>
        </header>
        <div class="article-body">
            {{- $emptyDatePages := slice}}
            {{- $currentYearSection := 0}}
            {{- range $idx,$page := .Site.RegularPages}}
                {{- if $page.Date}}
                    {{- $thisYear := $page.Date.Format ("2006") }}
                    {{- if eq $currentYearSection 0 }}
                        {{- $currentYearSection = $thisYear}}
                    {{- end }}
                    {{- if or (eq $idx 0) (ne $currentYearSection $thisYear)}}
                        {{- if ne $idx 0 }}
                        </div></div></div></section>
                        {{- end}}
                        <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>
                                        &nbsp;{{- $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">
                    {{- end}}
                    {{- .Scratch.Set "type" "link"}}
                    {{- partial "item-post.html" . }}
                {{- else}}
                    {{- $emptyDatePages = $emptyDatePages | append $page}}
                {{- end }}
            {{- end}}
            {{- if $emptyDatePages}} 
            </div></div></div></section>
            <section class="panel panel-default b-no">
                <div class="panel-heading" role="tab">
                    <h3 class="panel-title">
                        <a data-toggle="collapse" href="#collapse-other" aria-expanded="true">
                            <i class="icon icon-calendar-plus text-active"></i><i class="icon icon-calendar-minus text"></i>
                            &nbsp; Other
                        </a>
                    </h3>
                </div>
                <div id="collapse-other" class="panel-collapse collapse in" role="tabpanel"
                    aria-labelledby="heading-other">
                    <div class="panel-body">
                        <div class="collection">
                            {{- range $page := $emptyDatePages}}
                                {{- .Scratch.Set "type" "link"}}
                                {{- partial "item-post.html" . }}
                            {{- end}}
            {{- end }}
        </div></div></div></section>
        </div>
    </article>
</main>
{{- end }}