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

list.html « _default « layouts - github.com/spech66/bootstrap-bp-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2ecd3554debfcc716a0c1960562e08fc7e56be25 (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
{{- define "main" -}}

{{ $customDateFormat := "02.01.2006" }}
{{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }}
{{ $sitetitle := (.Title) }}

<div class="container mt-3 mb-3">
    {{ if .Site.Params.showListsGrouped }}
        <div class="mb-3">       
            <div class="card">
                <div class="card-body">
                    <h1>{{ $sitetitle }}</h1>
                    {{ range $key, $value := .Pages.GroupByDate "2006" }}
                        <a href="#{{ .Key | urlize }}" class="badge bg-primary"><span>{{ .Key }}</span> <span class="badge bg-light">{{ len .Pages }}</span></a>
                    {{ end}}
                </div>
            </div>
        </div>
        {{ range .Pages.GroupByDate "2006" }} 
            <div class="mb-3">    
                <div class="card">
                    <div class="card-body">  
                        <h2 id="{{ .Key | urlize }}">{{ .Key }}</h2>
                        <ul>
                            {{ range .Pages }}
                                <li>{{ .PublishDate.Format $customDateFormat }} - <a href="{{ .RelPermalink }}" title="{{ .Title }}">{{ .Title }}</a></li>
                            {{ end}}
                        </ul>
                    </div>
                </div>
            </div>
        {{ end }}
    {{ else }}
        <div class="mb-3">    
            <div class="card">
                <div class="card-body">  
                    <h1>{{ .Title }}</h1>
                    <ul>
                        {{ range .Pages.ByPublishDate.Reverse }}
                            <li>{{ .PublishDate.Format $customDateFormat }} - <a href="{{ .RelPermalink }}" title="{{ .Title }}">{{ .Title }}</a></li>
                        {{ end}}
                    </ul>
                </div>
            </div>
        </div>
    {{ end }}
</div>

{{- end -}}