{{ define "body-class" }} {{ if isset .Params "series" }} {{ $TOCEnabled := default (default false .Site.Params.article.toc) .Params.toc }} {{- .Scratch.Set "hasTOC" (and (ge (len .TableOfContents) 100) $TOCEnabled) -}} {{- .Scratch.Set "current_w" .Params.series_weight -}} {{- .Scratch.Set "series_name" .Params.series -}} article-page has-toc {{ else }} {{ $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 }} /* article-page */ {{ end }} {{ end }} {{ define "container-class" }} {{ if isset .Params "series" }} {{ if (.Scratch.Get "hasTOC") }} extended {{ else }} on-phone--column {{ if .Site.Params.widgets.enabled }}extended{{ else }}compact{{ end }} {{ end }} {{ else }} {{ if (.Scratch.Get "hasTOC") }} extended {{ else }} on-phone--column {{ if .Site.Params.widgets.enabled }}extended{{ else }}compact{{ end }} {{ end }} {{ end }} {{ end }} {{ define "main" }} {{ partial "article/article.html" . }} {{ if .Params.links }} {{ partial "article/components/links" . }} {{ end }} {{ partial "article/components/related-contents" . }} {{ if not (eq .Params.comments false) }} {{ partial "comments/include" . }} {{ end }} {{ partialCached "footer/footer" . }} {{ partialCached "article/components/photoswipe" . }} {{ end }} {{ define "left-sidebar" }} {{ if isset .Params "series" }} {{ if eq (.Scratch.Get "current_w") 1 }}
{{ else }} {{ range where (where .Site.Pages "Params.series_weight" (add (.Scratch.Get "current_w" | int) -1)) "Params.series" (.Scratch.Get "series_name") }} {{ end }} {{ end }} {{ else }} {{ if (.Scratch.Get "hasTOC") }} {{ else }} {{ partial "sidebar/left.html" . }} {{ end }} {{ end }} {{ end }} {{ define "right-sidebar" }} {{ if isset .Params "series" }} {{ else }} {{ if (.Scratch.Get "hasTOC") }} {{ end }} {{ end }} {{ end }}