From c86bdecb0ae8ac9a08376b72dcea93453511c2de Mon Sep 17 00:00:00 2001 From: Leon Date: Sun, 17 Jan 2021 17:16:45 +0100 Subject: [PATCH] [FEATURE] Utteranc.es support --- README.md | 6 ++++++ exampleSite/config.toml | 6 ++++++ exampleSiteMultilingual/config.toml | 6 ++++++ layouts/_default/single.html | 4 ++++ layouts/partials/utterances.html | 11 +++++++++++ 5 files changed, 33 insertions(+) create mode 100644 layouts/partials/utterances.html diff --git a/README.md b/README.md index 0036d09..6cc07ac 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/). - Mobile support - Google Analytics - Disqus +- Utteranc.es - RSS feeds - Translations (en, ru, fr, pl) - Custom CSS/JS @@ -70,6 +71,11 @@ params: paginationSinglePost: true style: light-without-switcher readMore: false + # utteranc.es support + utterancesRepo: "" # mandatory + utterancesTheme: "" # optional + utterancesIssue: "" # optional + utterancesLabel: "" # optional webmentions: login: hugo-theme-anubis pingback: true diff --git a/exampleSite/config.toml b/exampleSite/config.toml index b3fb036..2e330db 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -18,6 +18,12 @@ googleAnalytics = "" style = "light-without-switcher" readMore = false + # utteranc.es support + utterancesRepo = "" # mandatory + utterancesTheme = "" # optional + utterancesIssue = "" # optional + utterancesLabel = "" # optional + [menu] [[menu.main]] diff --git a/exampleSiteMultilingual/config.toml b/exampleSiteMultilingual/config.toml index a04f2a6..03eb0d1 100644 --- a/exampleSiteMultilingual/config.toml +++ b/exampleSiteMultilingual/config.toml @@ -19,6 +19,12 @@ googleAnalytics = "" style = "light-without-switcher" readMore = false + # utteranc.es support + utterancesRepo = "" # mandatory + utterancesTheme = "" # optional + utterancesIssue = "" # optional + utterancesLabel = "" # optional + [languages.en] languageName = "English" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 8d1e3b7..f12847b 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -25,4 +25,8 @@ {{ template "_internal/disqus.html" . }} {{ end }} + {{ if .Site.Params.UtterancesRepo }} + {{ partial "utterances.html" . }} + {{ end }} + {{ end }} \ No newline at end of file diff --git a/layouts/partials/utterances.html b/layouts/partials/utterances.html new file mode 100644 index 0000000..1c633a7 --- /dev/null +++ b/layouts/partials/utterances.html @@ -0,0 +1,11 @@ +{{ $theme := .Site.Params.UtterancesTheme | default "github-light" }} +{{ $label := .Site.Params.UtterancesLabel | default "" }} +{{ $issue := .Site.Params.UtterancesIssue | default "url" }} + \ No newline at end of file