Skip to content

Commit

Permalink
Merge pull request htr3n#50 from gamingrobot/utterances-support
Browse files Browse the repository at this point in the history
Add support for Utterances comments
  • Loading branch information
htr3n authored Nov 5, 2018
2 parents f00f5b7 + 46a8c1c commit 7b61fc3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
* `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.

```toml
Expand Down
5 changes: 4 additions & 1 deletion exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#UtterancesTheme = "..." # github-light or github-dark

# Table of contents
#toc = none, "hugo", or "tocbot"
Expand Down
7 changes: 7 additions & 0 deletions layouts/partials/page-single/comment/utterances.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script src="https://utteranc.es/client.js"
repo="{{ .Site.Params.UtterancesRepo }}"
issue-term="{{ .Site.Params.UtterancesIssueTerm }}"
theme="{{ with .Site.Params.UtterancesTheme }}{{ . }}{{else}}github-light{{ end }}"
crossorigin="anonymous"
async>
</script>
2 changes: 2 additions & 0 deletions layouts/partials/page-single/post-comment.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 7b61fc3

Please sign in to comment.