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: fcbfef45957e1d32f9b666cc4881fbc902baf820 (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
{{ define "main" }}
  
  {{ $currentTitle := .Scratch.Get "currentTitle" }}
  
  <!-- Collect pages using the "search" layout -->
  {{ $searchPages := where .Site.RegularPages "Layout" "eq" "search" }}
  
  <main class="list">

    <!-- Display search form before listing posts -->
    {{ if and .Site.Params.Search.enable (gt (len $searchPages) 0) (eq .Kind "section") }}
      {{ partial "search-form" . }}
    {{ end }}
    
    <h1>{{ $currentTitle }}</h1>
    
    {{ if eq .Kind "taxonomyTerm" }}
      {{ if eq .Type "categories" }}
        {{ partial "categories" . }}
      {{ else if eq .Type "tags" }}
        {{ partial "tags" . }}
      {{ end }}
    {{ else }}

      {{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}

      <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 }}

{{ define "svg-extra" }}
    <symbol viewBox="0 0 256 512" id="angle-right">
      <path d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"/>
    </symbol>

    <symbol viewBox="0 0 448 512" id="angle-double-right">
      <path d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"/>
    </symbol>
{{ end }}