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

taxonomy.html « _default « layouts - github.com/zzossig/hugo-theme-zdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 66c49bb8296b3b1f5bb2ed8928cccd20d72b9ae2 (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
{{ define "main" }}
<div class="top">
  <header class="main">
    <div class="sv" data-view="full">
      {{ partial "header/taxo-header.html" . }}
    </div>
  </header>
</div>
<div class="mid">
  <main class="main">
    <div class="sv" data-view="full">
      {{ $paginator := .Paginate (.Pages.GroupByDate (.Site.Params.taxoGroupByDate | default "2006")) .Site.Params.taxoPaginate }}
      
      {{ range ($paginator).PageGroups }}
        <span class="taxo__key">{{ .Key }}</span>
        <ul class="taxo__ul">
          {{ range .Pages }}
          <li class="taxo__li">
            <a href="{{ .Permalink }}" class="taxo__title">{{ .Title }}</a>
          </li>
          {{ end }}
        </ul>
      {{ end }}

      {{ partial "main/component/pagination.html" . }}
    </div>

  </main>
</div>

<script>
  var singleViewElem = document.querySelectorAll('.sv');

  enquire.register("screen and (max-width:1280px)", {
    match: function () {
      singleViewElem.forEach(function (elem) {
        elem.setAttribute('data-view', 'full');
      });
    },
    unmatch: function () {
      singleViewElem.forEach(function (elem) {
        elem.setAttribute('data-view', 'full');
      });
    },
  }).register("screen and (max-width:769px)", {
    match: function () {
      singleViewElem.forEach(function (elem) {
        elem.setAttribute('data-view', 'mobile');
      });
    },
    unmatch: function () {
      singleViewElem.forEach(function (elem) {
        elem.setAttribute('data-view', 'full');
      });
    },
  });
</script>
{{ end }}