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

section.html « blog « layouts - github.com/zzossig/hugo-theme-zdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ac4f3ccf876461eb0ea9793170ab06f03adb5505 (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
64
65
66
67
68
69
70
71
{{ define "main" }}
<div class="top">
  <header class="header__wrapper bgcolor__header">
    <div class="divider">
      <div class="lmr">
        {{ partial "header/blog-header.html" . }}
      </div>
    </div>
  </header>
  
  <div class="header__wrapper bgcolor__breadcrumb">
    <div class="divider">
      <div class="lmr flexbox jc-center flex-wrap tag__wrapper">
        {{ range $index, $element := .Site.Taxonomies.tags }}
          {{ if $index }}
            <a href="{{ $element.Page.RelPermalink }}" class="tag">
              <span class="tag__text">
                {{ $element.Page.Title }}
              </span>
              <span class="tag__num" dir="auto">
                {{ printf "%#v" (len $element) }}
              </span>
            </a>
          {{ end }}
        {{ end }}
      </div>
    </div>
  </div>
</div>
<div class="mid blog__bg">
  <main class="main blog__bg">
    <div class="sv" data-view="full">
      <div class="blog">
        {{ $paginator := .Paginate (where .RegularPages "Type" .Type) }}
        {{ range $paginator.Pages }}
          {{ .Render "summary" }}
        {{ end }}
        {{ partial "main/component/pagination.html" . }}
      </div>
    </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 }}