From 29aa348daab6bf2e621314426dd8819e927290f6 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Fri, 15 Mar 2019 11:03:46 +0100 Subject: [PATCH] Move comments handling in a partial (#138) This way it's much easier to tune the comment handling in general (like disable it for some sections) or integrate a different commenting system than disqus. --- layouts/_default/single.html | 4 +--- layouts/blog/single.html | 4 +--- layouts/partials/comments.html | 5 +++++ layouts/projects/single.html | 4 +--- 4 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 layouts/partials/comments.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 2b7793f..8bae45d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,7 +3,5 @@ {{ .Content }} -
- {{ template "_internal/disqus.html" . }} -
+ {{ partial "comments.html" . }} {{ end }} diff --git a/layouts/blog/single.html b/layouts/blog/single.html index 7eeaf40..53ab6a2 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -57,7 +57,5 @@ {{ .Content }} -
- {{ template "_internal/disqus.html" . }} -
+ {{ partial "comments.html" . }} {{ end }} diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html new file mode 100644 index 0000000..3cc1645 --- /dev/null +++ b/layouts/partials/comments.html @@ -0,0 +1,5 @@ +{{- if .Site.DisqusShortname }} +
+ {{ template "_internal/disqus.html" . }} +
+{{- end }} diff --git a/layouts/projects/single.html b/layouts/projects/single.html index 98176e8..819f8f3 100644 --- a/layouts/projects/single.html +++ b/layouts/projects/single.html @@ -24,9 +24,7 @@ {{ .Content }} -
- {{ template "_internal/disqus.html" . }} -
+ {{ partial "comments.html" . }} {{ end }} {{ define "customCSS" }}