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

terms.html « _default « layouts - github.com/shaform/hugo-theme-den.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7dd33edc48bb22428e4cd84ee99afba9d7dd4b30 (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
{{ define "title" }}{{ i18n .Data.Plural }} · {{ .Site.Title }}{{ end }}

{{ define "header" }}
<div class="container header-wrapper">
  <div class="row">
    <div class="col-lg-12">
      <div class="header-content">
        <h1 class="header-title text-uppercase">
          {{ i18n .Data.Plural }}
        </h1>
        <div class="header-underline"></div>
        <p class="header-subtitle header-subtitle-homepage">
          {{ i18n (printf "list_of_%s" .Data.Plural) }}
        </p>
      </div>
    </div>
  </div>
</div>
{{ end }}

{{ define "main" }}
{{ $termName := .Data.Plural }}
{{ $type := .Type }}
<div class="archive-container">
    <div class="container content archive">
    {{ if and $.Site.Taxonomies.categories (eq $termName "categories") }}
      {{ range .Data.Terms.ByCount }}
        {{ $name := .Name }}
        {{ $pages := .Pages }}
        {{ with $.Site.GetPage "taxonomy" $type .Term }}
          <h2><a href="{{ .Permalink }}">{{ $name }}</a></h2>
          <dl class="row">
              {{ range first ($.Site.Params.numListPosts | default 10) $pages }}
              <dt class="col-md-3">{{ .Date.Format ($.Site.Params.dateFormatToUse | default "Mon 02 January 2006") }}</dt>
              <dd class="col-md-9"><a href="{{ .URL }}">{{ .Title }}</a></dd>
              {{ end }}
          </dl>
          {{ if gt (len $pages) ($.Site.Params.numListPosts | default 10) }}
            <div class="more-post">
              <a href="{{ .Permalink }}" class="more-post-link btn btn-light">{{ i18n "more_post" }}</a>
            </div>
          {{ end }}
        {{ end }}
      {{ end }}
    {{ else if and $.Site.Taxonomies.tags (eq $termName "tags") }}
      <h2><a href="{{ .URL }}">{{ i18n (printf "list_of_%s" .Data.Plural) }}</a></h2>
      <dl class="row">
      {{ range .Data.Terms.Alphabetical }}
        {{ $name := .Name }}
        {{ $count := len .Pages }}
        {{ with $.Site.GetPage "taxonomy" $type .Term }}
            <dt class="col-md-3"><span class="badge badge-secondary">{{ $count }}</span> {{ if gt $count 1 }}{{ i18n "articles_tagged" }}{{ else }}{{ i18n "article_tagged" }}{{ end }}</dt>
            <dd class="col-md-9"><a href="{{ .Permalink }}">{{ $name }}</a></dd>
        {{ end }}
      {{ end }}
      </dl>
    {{ end }}
    </div>
</div>
{{ if not (eq $termName "tags") }}
{{ partial "pagination.html" . }}
{{ end }}
{{ end }}