diff --git a/README.md b/README.md index eb35279..b3098a4 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,9 @@ Enabled by `paginationSinglePost` param in `params` section of config. To provide webmention support you can **either** specify your webmention.io username with `login: webmentionusername` **or** specify a link to your custom webmention endpoint with `url: https://yourdomain.com/webemntions/receive`. If you use webmention.io you can also enable pingback with `pingback: true` +### Disabling comments per-page basis +Add `disableComments: true` to post front matter. + ## Contributing If you find a bug or have an idea for a feature, feel free to write an [issue](https://github.com/mitrichius/hugo-theme-anubis/issues) or make a PR. diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c25a022..a7905bc 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -37,20 +37,7 @@ {{ partial "post-pagination.html" . }} {{ end }} - {{ if .Site.DisqusShortname }} - {{ partial "disqus.html" . }} + {{ if not .Params.disableComments }} + {{ partial "comments.html" . }} {{ end }} - - {{ if .Site.Params.UtterancesRepo }} - {{ partial "utterances.html" . }} - {{ end }} - - {{ if .Site.Params.isso.enabled }} - {{ partial "isso.html" . }} - {{ end }} - - {{ if .Site.Params.graphcommentId }} - {{ partial "graphcomment.html" . }} - {{ end }} - {{ end }} diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html new file mode 100644 index 0000000..079e0f9 --- /dev/null +++ b/layouts/partials/comments.html @@ -0,0 +1,15 @@ +{{ if .Site.DisqusShortname }} + {{ partial "disqus.html" . }} +{{ end }} + +{{ if .Site.Params.UtterancesRepo }} + {{ partial "utterances.html" . }} +{{ end }} + +{{ if .Site.Params.isso.enabled }} + {{ partial "isso.html" . }} +{{ end }} + +{{ if .Site.Params.graphcommentId }} + {{ partial "graphcomment.html" . }} +{{ end }}