diff options
author | Paul <paul@brainspark.nl> | 2020-04-01 23:56:14 +0300 |
---|---|---|
committer | Paul <paul@brainspark.nl> | 2020-04-01 23:56:24 +0300 |
commit | e814758445faaa43bf7e50c7b678d27882c30ecb (patch) | |
tree | 0c5a011ba58d4dbcd8442d68fbb4153d0175cb0d | |
parent | 214c53d253e90840cd15c279acbda91d1966ff1f (diff) |
Support for Disqus with ability to disable in pages
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | layouts/_default/single.html | 7 |
2 files changed, 11 insertions, 0 deletions
@@ -73,6 +73,10 @@ After Bootstrap and this theme's CSS file (*/static/css/theme.css*), the empty l Assuming you already signed up for [Google Analytics](https://www.google.com/analytics/), you can add your Google Tracking ID to the `googleAnalytics` parameter in `config.toml`. It will then automatically include Google Analytics code in your site. +## Disqus support + +When `DisqusShortname` is set in your site's config, all regular pages will have Disqus enabled at the bottom. You can disable this on a page-by-page basis by setting `comments` to `false` in a page's front matter. + ## License MIT Licensed, see [LICENSE](https://github.com/pjbakker/flexible-seo-hugo/blob/master/LICENSE). diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e2d4df6..cd6add4 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -40,6 +40,13 @@ </div> {{ end }} </div> + {{ if and .Site.DisqusShortname ( ne .Params.comments false ) -}} + <div class="row justify-content-center pt-3"> + <div class="col-lg-8"> + {{ template "_internal/disqus.html" . }} + </div> + </div> + {{ end }} </article> </div> {{ end }} |