From 91ca408bddfd923cdcd35437db4dec318af99c78 Mon Sep 17 00:00:00 2001 From: Adam Ormsby Date: Tue, 24 Dec 2019 09:32:31 +0700 Subject: [PATCH 1/3] disable comments on non-specific page types --- layouts/_default/single.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 4eda128..346e430 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -60,7 +60,9 @@ {{ end }} {{ end }} - - {{ partial "comments.html" . }} + + {{ if eq .Type $.Site.Params.contentTypeName }} + {{ partial "comments.html" . }} + {{ end }} {{ end }} From d9ade4410a02f8b66d87838802115ead888f280a Mon Sep 17 00:00:00 2001 From: Adam Ormsby Date: Fri, 27 Dec 2019 14:32:20 +0700 Subject: [PATCH 2/3] add check for comments param --- layouts/_default/single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 346e430..7f42880 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -61,7 +61,7 @@ {{ end }} {{ end }} - {{ if eq .Type $.Site.Params.contentTypeName }} + {{ if or (eq .Type $.Site.Params.contentTypeName) (.Params.Comments) }} {{ partial "comments.html" . }} {{ end }} From 28b6f11618025cb58584ef1c0f4dfccfb1d494d6 Mon Sep 17 00:00:00 2001 From: Adam Ormsby Date: Fri, 27 Dec 2019 14:51:52 +0700 Subject: [PATCH 3/3] add comments=false check --- layouts/_default/single.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7f42880..19cd9ac 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -61,8 +61,12 @@ {{ end }} {{ end }} - {{ if or (eq .Type $.Site.Params.contentTypeName) (.Params.Comments) }} - {{ partial "comments.html" . }} + + {{ if not (eq .Params.Comments "false") }} + {{ if or (eq .Type $.Site.Params.contentTypeName) (.Params.Comments) }} + {{ partial "comments.html" . }} + {{ end }} {{ end }} + {{ end }}