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

list.html « _default « layouts - gitlab.com/rmaguiar/hugo-theme-color-your-world.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 30700792330dc373c9a5e68ad0e99852fa93adf7 (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
{{ define "main" }}
  
  {{ $currentTitle := .Scratch.Get "currentTitle" }}
  
  <main class="list">
  
    <h1>{{ $currentTitle }}</h1>
    
    {{ if eq .Kind "taxonomyTerm" }}
      {{ if eq .Type "categories" }}
        {{ partial "categories" . }}
      {{ else if eq .Type "tags" }}
        {{ partial "tags" . }}
      {{ end }}
    {{ else }}

      {{ $pages := where site.RegularPages "Type" "in" .Site.Params.mainSections }}
      
      {{ $paginator := .Paginate .Pages }}

      <ul class="posts">
        {{ range $paginator.Pages }}
          <li>
            <a class="btn" href="{{ .RelPermalink }}">
              <p>{{ .LinkTitle | emojify }}</p>
              {{ if not .Date.IsZero }}<time datetime="{{ .Date | dateFormat "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time>{{ end }}
            </a>
          </li>
        {{ end }}
      </ul>
      
      {{ partial "pagination" . }}

      {{ if and (gt (len .Site.Taxonomies.tags) 1) (ne .Section "categories") }}
        <hr>
        <h2>{{ T "tags" }}</h2>
        {{ partial "tags" . }}
      {{ end }}

    {{ end }}
    
  </main>
  
{{ end }}