Comments toggeled per-page and add default setting

Comments toggeled per-page by setting "comments = true" or "comments =
false" in front matter. If not set, will use new default setting defined
in config.toml.
This commit is contained in:
Michael Romero 2017-03-06 15:20:59 -08:00
parent 0338abd814
commit 43fd0bb8bd
5 changed files with 20 additions and 12 deletions

View File

@ -14,6 +14,7 @@ pygmentCodeFences = true
dateFormat = "January 2, 2006"
commit = false
rss = true
comments = true
[Author]
name = "Some Person"

View File

@ -1,6 +1,7 @@
---
title: About me
subtitle: Why you'd want to go on a date with me
comments: false
---
My name is Inigo Montoya. I have the following qualities:

View File

@ -1,5 +1,7 @@
{{ if .Site.DisqusShortname }}
<div class="comments">
{{ template "_internal/disqus.html" . }}
</div>
{{ if (.Params.comments) | or (and (not (isset .Params "comments")) (.Site.Params.comments)) }}
{{ if .Site.DisqusShortname }}
<div class="comments">
{{ template "_internal/disqus.html" . }}
</div>
{{ end }}
{{ end }}

View File

@ -2,10 +2,12 @@
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
{{ .Content }}
{{ if .Site.DisqusShortname }}
<div class="disqus-comments">
{{ template "_internal/disqus.html" . }}
</div>
{{ if (.Params.comments) | or (and (not (isset .Params "comments")) (.Site.Params.comments)) }}
{{ if .Site.DisqusShortname }}
<div class="disqus-comments">
{{ template "_internal/disqus.html" . }}
</div>
{{ end }}
{{ end }}
</div>
</div>

View File

@ -18,10 +18,12 @@
{{ end }}
</ul>
{{ if .Site.DisqusShortname }}
<div class="disqus-comments">
{{ template "_internal/disqus.html" . }}
</div>
{{ if (.Params.comments) | or (and (not (isset .Params "comments")) (.Site.Params.comments)) }}
{{ if .Site.DisqusShortname }}
<div class="disqus-comments">
{{ template "_internal/disqus.html" . }}
</div>
{{ end }}
{{ end }}
</div>