From b099c5e9415a755c177a5cce3a1def83f65417cf Mon Sep 17 00:00:00 2001 From: vimux Date: Sun, 27 May 2018 00:02:06 +0300 Subject: [PATCH] Use .Param for TOC and comments Enable/disable "TOC" and "comments" partials for all site or specific posts. See: https://gohugo.io/functions/param/ --- layouts/partials/comments.html | 2 +- layouts/partials/post_toc.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index ad3ca18..839400a 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,4 +1,4 @@ -{{ if and .Site.DisqusShortname (not (or .Site.Params.comments .Params.comments)) }} +{{ if and (.Site.DisqusShortname) (.Param "comments") }}
{{ template "_internal/disqus.html" . }}
diff --git a/layouts/partials/post_toc.html b/layouts/partials/post_toc.html index b081932..436b71b 100644 --- a/layouts/partials/post_toc.html +++ b/layouts/partials/post_toc.html @@ -1,4 +1,4 @@ -{{ if .Params.toc }} +{{ if .Param "toc" }}
{{- T "post_toc" -}} {{ .TableOfContents }}