Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/yursan9/manis-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYurizal Susanto <yursan9@pm.me>2019-09-04 06:31:47 +0300
committerYurizal Susanto <yursan9@pm.me>2019-09-04 06:34:29 +0300
commit120f0b2120a87a27ed8a0b18795f128b0e2fa6e7 (patch)
tree5841353d70ff4149e0e4ba98f08e332a14f35da6
parent0c314fde003a7b4d3f12e43228b9c55b6a96b7c1 (diff)
Add utterances support
So, we have alternative of disqus now!
-rw-r--r--README.md1
-rw-r--r--exampleSite/config.toml12
-rw-r--r--layouts/_default/single.html3
-rw-r--r--layouts/partials/utterances.html10
4 files changed, 24 insertions, 2 deletions
diff --git a/README.md b/README.md
index ce7fa3b..45c2422 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,7 @@ Like I said, it's really minimal. Its doesn't even have grid or anything nice li
- Social Icon Links.
- No Grid no worry.
- Disqus Support.
+- [Utterances](https://utteranc.es) Support.
- Translatable.
![Manis' Homepage view](https://raw.githubusercontent.com/yursan9/manis-hugo-theme/master/images/blue-red.png)
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 68e50fc..4a151f1 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -37,8 +37,6 @@ pygmentsUseClasses = true
# Custom CSS
customCSS = []
- # List of sections that support disqus comments
- disqusSections = [ "blog" ]
# Site meta description
description = "Sweet little Hugo's theme for personal website or blog."
# Site's Tagline (Subtitle or Keyword)
@@ -52,6 +50,16 @@ pygmentsUseClasses = true
mainSections = ["blog", "post"]
# Configure which sections for Latest Works
workSections = ["work"]
+
+ # List of sections that support disqus comments
+ disqusSections = [ "blog" ]
+ # List of sections that support utterances comments
+ utterancesSections = [ "blog" ]
+
+ # Utterances Configuration
+ utterancesRepo = ""
+ utterancesTheme = "github-light"
+ utterancesLabel = ""
# 404 Configuration
head404 = "Sorry, I can't find what you want."
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 45c6386..d88c5e4 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -18,6 +18,9 @@
{{ end }}
</nav>
{{ partial "related" . }}
+{{ if in .Site.Params.UtterancesSections .Section}}
+ {{ partial "utterances" .}}
+{{ end }}
{{ if in .Site.Params.DisqusSections .Section }}
{{ partial "disqus" . }}
{{ end }}
diff --git a/layouts/partials/utterances.html b/layouts/partials/utterances.html
new file mode 100644
index 0000000..011ad8b
--- /dev/null
+++ b/layouts/partials/utterances.html
@@ -0,0 +1,10 @@
+{{ theme := .Site.Params.UtterancesTheme | default "github-light" }}
+{{ label := .Site.Params.UtterancesLabel | default "" }}
+<script src="https://utteranc.es/client.js"
+ repo="{{- .Site.Params.UtterancesRepo -}}"
+ issue-term="url"
+ label="{{ $label }}"
+ theme="{{ $theme }}"
+ crossorigin="anonymous"
+ async>
+</script>