diff --git a/layouts/post/single.html b/layouts/post/single.html index dffd479..30240a9 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -1,5 +1,7 @@ -{{ .Scratch.Set "hasTOC" (ge (len .TableOfContents) 100) }} -{{ define "body-class" }}article-page keep-sidebar{{ if .Scratch.Get "hasTOC" }} has-toc{{ end }}{{ end }} +{{ define "body-class" }} + {{- .Scratch.Set "hasTOC" (ge (len .TableOfContents) 100) -}} + article-page keep-sidebar{{ if (.Scratch.Get "hasTOC") }} has-toc{{ end }} +{{ end }} {{ define "container-class" }}extended{{ end }} {{ define "main" }} {{ partial "article/article.html" . }} @@ -16,7 +18,7 @@ {{ end }} {{ define "left-sidebar" }} - {{ if .Scratch.Get "hasTOC" }} + {{ if (.Scratch.Get "hasTOC") }}