2021-06-21 12:44:54 -04:00
|
|
|
{{ define "body-class" }}
|
|
|
|
{{ $TOCEnabled := default (default false .Site.Params.article.toc) .Params.toc }}
|
|
|
|
{{- .Scratch.Set "hasTOC" (and (ge (len .TableOfContents) 100) $TOCEnabled) -}}
|
|
|
|
article-page {{ if (.Scratch.Get "hasTOC") }}has-toc{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "container-class" }}
|
|
|
|
{{ if (.Scratch.Get "hasTOC") }}
|
|
|
|
extended
|
|
|
|
{{ else }}
|
|
|
|
on-phone--column {{ if .Site.Params.widgets.enabled }}extended{{ else }}compact{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
2020-08-22 07:20:08 -04:00
|
|
|
{{ define "main" }}
|
2020-09-12 04:33:53 -04:00
|
|
|
{{ partial "article/article.html" . }}
|
2020-08-22 07:20:08 -04:00
|
|
|
|
2021-06-21 12:44:54 -04:00
|
|
|
{{ partial "article/components/related-contents" . }}
|
|
|
|
|
2021-09-17 15:29:19 -04:00
|
|
|
{{ if not (eq .Params.comments false) }}
|
2020-09-12 04:33:53 -04:00
|
|
|
{{ partial "comments/include" . }}
|
|
|
|
{{ end }}
|
2020-08-22 07:20:08 -04:00
|
|
|
|
2020-09-12 04:33:53 -04:00
|
|
|
{{ partialCached "footer/footer" . }}
|
2020-08-22 07:20:08 -04:00
|
|
|
|
2020-09-17 15:46:48 -04:00
|
|
|
{{ partialCached "article/components/photoswipe" . }}
|
2021-06-21 12:44:54 -04:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "left-sidebar" }}
|
|
|
|
{{ if (.Scratch.Get "hasTOC") }}
|
|
|
|
<div id="article-toolbar">
|
|
|
|
<a href="{{ .Site.BaseURL }}" class="back-home">
|
|
|
|
{{ (resources.Get "icons/back.svg").Content | safeHTML }}
|
|
|
|
<span>{{ T "article.back" }}</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{{ else }}
|
|
|
|
{{ partial "sidebar/left.html" . }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "right-sidebar" }}
|
|
|
|
{{ if (.Scratch.Get "hasTOC") }}
|
|
|
|
<aside class="sidebar right-sidebar sticky">
|
|
|
|
<section class="widget archives">
|
|
|
|
<div class="widget-icon">
|
|
|
|
{{ partial "helper/icon" "hash" }}
|
|
|
|
</div>
|
|
|
|
<h2 class="widget-title section-title">{{ T "article.tableOfContents" }}</h2>
|
|
|
|
|
|
|
|
<div class="widget--toc">
|
|
|
|
{{ .TableOfContents }}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</aside>
|
|
|
|
{{ end }}
|
2021-09-17 15:29:19 -04:00
|
|
|
{{ end }}
|