blob: 0d27aee7497ea5a951792df578a5834df6f4999e (
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 .Site.Params.toc -}}
{{- $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>
|