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

post.html « partials « layouts - github.com/wlh320/hugo-theme-hulga.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 63c9d7cbced0e84bc0a49c3dbfbeccedbf87b4e0 (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
{{ partial "post-header.html" . }}
{{- $setToc := or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
{{- $headers := findRE "<h[1-3].*?>(.|\n])+?</h[1-3]>" .Content -}}
{{- $hasToc := ge (len $headers) 1 -}}
{{- $showToc := and $setToc $hasToc -}}
<section class="section">
  <div class="container">
    <div class="columns">
      {{ if $showToc }}
      <div class="column is-1 is-hidden-mobile"></div>
      <div class="column is-8">
      {{ else }}
      <div class="column is-three-fifths is-offset-one-fifth">
      {{ end }}
        <article class="content" id="post-content">
          {{- .Content -}}
        </article>
      </div>
      {{ if $showToc }}
      <div class="column is-hidden-mobile">
        <div class="sidebar" id="toc">
          {{ if $showToc }}
          <div class="post post-toc" id="post-toc">
            <!-- render by tocbot -->
          </div>
          {{- end }}
        </div>
      </div>
      {{ end }}
      </div>
    </div>
  </div>
</section>