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

single.html « blog « layouts - github.com/zzossig/hugo-theme-zdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9addd5221db9dbec8bf4d94a0a515acb5807fec1 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{{ define "main" }}
{{ $wideViewAsDefault := ($.Param "wideViewAsDefault") }}
<div class="mid">
  <div class="divider">
    
    <nav id="single-menu" class="{{ if $wideViewAsDefault }}hide{{ else }}l{{ end }}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
    </nav>

    <article id="list-main" class="{{ if $wideViewAsDefault }}lm{{ else }}m{{ end }}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
      {{ if $.Param "enableBlogBreadcrumb" }}
        {{ partial "main/component/breadcrumb.html" . }}
      {{ end }}
      {{ partial "main/sections/list-main.html" . }}
      {{ partial "main/component/pagination-single.html" . }}
    </article>
    
    <section id="list-side" class="r" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
      {{ if $.Param "enableToc" }}
        {{ partial "main/component/toc.html" . }}
      {{ end }}
    </section>

  </div>
</div>

{{ partial "script/single-script.html" . }}
<script>
  var listSide = document.getElementById('list-side');
  var listMain = document.getElementById('list-main');
  var singleMenu = document.getElementById('single-menu');
  var wideViewAsDefault = JSON.parse({{ $wideViewAsDefault | jsonify }});

  enquire.register("screen and (max-width:1280px)", {
    match: function () {
      if (wideViewAsDefault) {
        singleMenu.className = 'hide';
        listMain.className = 'lm';
        listSide.className = 'r';
      } else {
        singleMenu.className = 'l';
        listMain.className = 'm';
        listSide.className = 'r';
      }
    },
    unmatch: function () {
      if (wideViewAsDefault) {
        singleMenu.className = 'hide';
        listMain.className = 'lm';
        listSide.className = 'r';
      } else {
        singleMenu.className = 'l';
        listMain.className = 'm';
        listSide.className = 'r';
      }
    },
  }).register("screen and (max-width:960px)", {
    match: function () {
      listSide.className = 'r';
      listMain.className = 'lm';
      singleMenu.className = 'hide';
    },
    unmatch: function () {
      if (wideViewAsDefault) {
        singleMenu.className = 'hide';
        listMain.className = 'lm';
        listSide.className = 'r';
      } else {
        singleMenu.className = 'l';
        listMain.className = 'm';
        listSide.className = 'r';
      }
    },
  }).register("screen and (max-width:600px)", {
    match: function () {
      listSide.className = 'hide';
      listMain.className = 'lmr';
      singleMenu.className = 'hide';
    },
    unmatch: function () {
      listSide.className = 'r';
      listMain.className = 'lm';
      singleMenu.className = 'hide';
    },
  });
</script>
{{ end }}