diff options
author | Yurizal Susanto <yursan9@pm.me> | 2019-09-04 06:31:47 +0300 |
---|---|---|
committer | Yurizal Susanto <yursan9@pm.me> | 2019-09-04 06:34:29 +0300 |
commit | 120f0b2120a87a27ed8a0b18795f128b0e2fa6e7 (patch) | |
tree | 5841353d70ff4149e0e4ba98f08e332a14f35da6 | |
parent | 0c314fde003a7b4d3f12e43228b9c55b6a96b7c1 (diff) |
Add utterances support
So, we have alternative of disqus now!
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | exampleSite/config.toml | 12 | ||||
-rw-r--r-- | layouts/_default/single.html | 3 | ||||
-rw-r--r-- | layouts/partials/utterances.html | 10 |
4 files changed, 24 insertions, 2 deletions
@@ -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> |