From c5139fca2654a9d1a9909952eb5797a6f0b2f7fb Mon Sep 17 00:00:00 2001 From: Morgan Creekmore Date: Thu, 1 Nov 2018 22:17:45 -0500 Subject: [PATCH 1/2] Add support for Utterances comments --- README.md | 4 ++++ exampleSite/config.toml | 5 ++++- layouts/partials/page-single/comment/utterances.html | 7 +++++++ layouts/partials/page-single/post-comment.html | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/page-single/comment/utterances.html diff --git a/README.md b/README.md index 6faa9fa..53e6a24 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,10 @@ __`Hyde-hyde`__ essentially inherits most of Hyde's [options](https://github.com * `GraphCommentId = "your-graphcomment-id"`: to use [GraphComment](https://graphcomment.com) instead of the built-in [Disqus](https://disqus.com). This option should be used exclusively with `disqusShortname = "disqus-shortname"`. +* `UtterancesRepo = "your-repo-name"`: to use [Utterances](https://utteranc.es/) instead of the built-in [Disqus](https://disqus.com). This option should be used exclusively with `disqusShortname = "disqus-shortname"`. + * `UtterancesIssueTerm = "pathname"` Method for Utterances to match issue's to posts (pathname, url, title, og:title) + * `UtterancesIssueTheme = "github-light"` Theme for Utterances (github-light, github-dark) + * `[params.social]`: in this section, you can set many social identities such as Twitter, Facebook, Github, Bitbucket, Gitlab, Instagram, LinkedIn, StackOverflow, Medium, Xing, Keybase. ```toml diff --git a/exampleSite/config.toml b/exampleSite/config.toml index eda1a79..f9b0b67 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -23,8 +23,11 @@ theme = "hyde-hyde" dateformat = "Jan 2, 2006" highlightjs = true highlightjsstyle = "github" - # please choose either GraphComment or Disqus + # please choose either GraphComment or Disqus or Utterances #GraphCommentId = "..." + #UtterancesRepo = "..." # https://utteranc.es/ + #UtterancesIssueTerm = "..." # pathname, url, title, og:title + #UtterancesIssueTheme = "..." # github-light or github-dark # Table of contents #toc = none, "hugo", or "tocbot" diff --git a/layouts/partials/page-single/comment/utterances.html b/layouts/partials/page-single/comment/utterances.html new file mode 100644 index 0000000..9fd1348 --- /dev/null +++ b/layouts/partials/page-single/comment/utterances.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/layouts/partials/page-single/post-comment.html b/layouts/partials/page-single/post-comment.html index 4c942af..a9d2ab7 100644 --- a/layouts/partials/page-single/post-comment.html +++ b/layouts/partials/page-single/post-comment.html @@ -3,5 +3,7 @@ {{ partial "page-single/comment/disqus.html" . }} {{ else if .Site.Params.GraphCommentId }} {{ partial "page-single/comment/graphcomment.html" . }} + {{ else if .Site.Params.UtterancesRepo }} + {{ partial "page-single/comment/utterances.html" . }} {{ end }} {{ end }} From 11649d851c7b644fbfeba0de54b5ddd281c1c57b Mon Sep 17 00:00:00 2001 From: Morgan Creekmore Date: Thu, 1 Nov 2018 23:03:08 -0500 Subject: [PATCH 2/2] Fix param name, default to github-light --- README.md | 2 +- exampleSite/config.toml | 2 +- layouts/partials/page-single/comment/utterances.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53e6a24..7ef8bf4 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ __`Hyde-hyde`__ essentially inherits most of Hyde's [options](https://github.com * `UtterancesRepo = "your-repo-name"`: to use [Utterances](https://utteranc.es/) instead of the built-in [Disqus](https://disqus.com). This option should be used exclusively with `disqusShortname = "disqus-shortname"`. * `UtterancesIssueTerm = "pathname"` Method for Utterances to match issue's to posts (pathname, url, title, og:title) - * `UtterancesIssueTheme = "github-light"` Theme for Utterances (github-light, github-dark) + * `UtterancesTheme = "github-light"` Theme for Utterances (github-light, github-dark) * `[params.social]`: in this section, you can set many social identities such as Twitter, Facebook, Github, Bitbucket, Gitlab, Instagram, LinkedIn, StackOverflow, Medium, Xing, Keybase. diff --git a/exampleSite/config.toml b/exampleSite/config.toml index f9b0b67..d0412d2 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -27,7 +27,7 @@ theme = "hyde-hyde" #GraphCommentId = "..." #UtterancesRepo = "..." # https://utteranc.es/ #UtterancesIssueTerm = "..." # pathname, url, title, og:title - #UtterancesIssueTheme = "..." # github-light or github-dark + #UtterancesTheme = "..." # github-light or github-dark # Table of contents #toc = none, "hugo", or "tocbot" diff --git a/layouts/partials/page-single/comment/utterances.html b/layouts/partials/page-single/comment/utterances.html index 9fd1348..008998e 100644 --- a/layouts/partials/page-single/comment/utterances.html +++ b/layouts/partials/page-single/comment/utterances.html @@ -1,7 +1,7 @@ \ No newline at end of file