funkydan2 / hugo-kiera

Kiera - A Hugo Theme for writing
https://hugo-kiera.netlify.app
MIT License
71 stars 53 forks source link

Document how to use Utterances #29

Closed lovesegfault closed 4 years ago

lovesegfault commented 4 years ago

Utterances support has been added, but it's not documented how to enable it and use it

funkydan2 commented 4 years ago

@lovesegfault, I haven't used Utterances. I think you enable it in your config file

[params]
    utterancesRepo = https://github.com/MyRepo

Can you test if this works?

lovesegfault commented 4 years ago

That doesn't work, but I found out it's because all of the options are not properly capitalized and one is improperly named. I'll make a PR to fix it.

lovesegfault commented 4 years ago

Actually, scratch that, apparently we're mixing camelCase and PascalCase

lovesegfault commented 4 years ago

@funkydan2 Apparently that broke something: https://github.com/lovesegfault/lovesegfault.github.io/commit/f0cbf2039de2324738e72edfb5baef618ab75834/checks?check_suite_id=464124943

I'm investigating

lovesegfault commented 4 years ago

Alright, here's the patch that fixes it, I'll post a PR in a moment.

diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html
index 8e82d79..cd9b2ec 100644
--- a/layouts/partials/disqus.html
+++ b/layouts/partials/disqus.html
@@ -12,7 +12,7 @@
                   return;

             var disqus_loaded = false;
-            var disqus_shortname = '{{ .Site.disqusShortname }}';
+            var disqus_shortname = '{{ .Site.Params.disqusShortname }}';
             var disqus_button = document.getElementById("show-comments");

             disqus_button.style.display = "";
diff --git a/layouts/partials/single_footer.html b/layouts/partials/single_footer.html
index bf95250..ecfa4a3 100644
--- a/layouts/partials/single_footer.html
+++ b/layouts/partials/single_footer.html
@@ -16,7 +16,7 @@
     {{ if .Site.Params.utterancesRepo }}
         {{ partial "utterances" . }}
     {{ end }}
-    {{ if .Site.disqusShortname }}
+    {{ if .Site.Params.disqusShortname }}
         {{ partial "disqus" . }}
     {{ end }}
 {{ end }}