diff options
author | Kevin Ottens <ervin@ipsquad.net> | 2019-03-15 13:03:46 +0300 |
---|---|---|
committer | Hanzei <16541325+hanzei@users.noreply.github.com> | 2019-03-15 13:03:46 +0300 |
commit | 29aa348daab6bf2e621314426dd8819e927290f6 (patch) | |
tree | 3bdfcfc97b91a151276d00d1d4443ec97208fa5f /layouts | |
parent | a8f42fd1d688424555b012fa55820ea9f982e3a5 (diff) |
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.
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/single.html | 4 | ||||
-rw-r--r-- | layouts/blog/single.html | 4 | ||||
-rw-r--r-- | layouts/partials/comments.html | 5 | ||||
-rw-r--r-- | layouts/projects/single.html | 4 |
4 files changed, 8 insertions, 9 deletions
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 }} </div> <!-- End post content --> - <div class="disqus"> - {{ template "_internal/disqus.html" . }} - </div> + {{ 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 }} </div> <!-- End blog post content --> - <div class="disqus"> - {{ template "_internal/disqus.html" . }} - </div> + {{ 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 }} + <div class="disqus"> + {{ template "_internal/disqus.html" . }} + </div> +{{- 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 }} </div> <!-- End post content --> - <div class="disqus"> - {{ template "_internal/disqus.html" . }} - </div> + {{ partial "comments.html" . }} {{ end }} {{ define "customCSS" }} |