From a460bf8838987df08acea5c8f906a26015489224 Mon Sep 17 00:00:00 2001
From: Kirill K <agrrh@users.noreply.github.com>
Date: Sun, 09 Jun 2019 19:46:06 +0000
Subject: [PATCH] Add commento (#178)

---
 layouts/_default/single.html   |    9 +++++++--
 layouts/partials/commento.html |    2 ++
 README.md                      |   13 +++++++++----
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 435db6a..a4ece69 100644
--- a/README.md
+++ b/README.md
@@ -10,9 +10,9 @@
 
 - Responsive
 - Accessible
-- Contact form 
+- Contact form
 - Custom Robots.txt (changes values based on environment)
-- Internal templates for meta data, google analytics, and DISQUS comments
+- Internal templates for meta data, google analytics, and DISQUS or COMMENTO comments
 - RSS Discovery
 - Table of Contents (must declare `toc: true` in post parameter)
 
@@ -71,9 +71,14 @@
 
 ### Add comments
 
-To enable DISQUS comments, add `disqusShortname = YOURSHORTNAME` to your config file.
+To enable comments, add following to your config file:
 
-
+- DISQUS: `disqusShortname = YOURSHORTNAME`
+- COMMENTO:
+  ```
+  [params]
+    commentoEnable = true`
+  ```
 
 ### Change the hero background
 
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index efd8e05..fde3f74 100755
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -21,8 +21,8 @@
       {{/* Hugo uses Go's date formatting is set by example. Here are two formats */}}
       <time class="f6 mv4 dib tracked" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
         {{- .Date.Format "January 2, 2006" -}}
-      </time>      
-      {{/*  
+      </time>
+      {{/*
           Show "reading time" and "word count" but only if one of the following are true:
           1) A global config `params` value is set `show_reading_time = true`
           2) A section front matter value is set `show_reading_time = true`
@@ -38,7 +38,12 @@
       {{- .Content -}}
       {{- partial "tags.html" . -}}
       <div class="mt6">
+      {{ if .Site.DisqusShortname }}
         {{ template "_internal/disqus.html" . }}
+      {{ end }}
+      {{ if .Site.Params.commentoEnable }}
+        {{- partial "commento.html" . -}}
+      {{ end }}
       </div>
     </section>
 
diff --git a/layouts/partials/commento.html b/layouts/partials/commento.html
new file mode 100644
index 0000000..54e7589
--- /dev/null
+++ b/layouts/partials/commento.html
@@ -0,0 +1,2 @@
+<div id="commento"></div>
+<script defer src="https://cdn.commento.io/js/commento.js"></script>

--
Gitblit v1.10.0