Merge pull request #50 from gamingrobot/utterances-support

Add support for Utterances comments
This commit is contained in:
Huy Tran 2018-11-05 16:56:07 +11:00 committed by GitHub
commit 0bcd6e7c83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 1 deletions

View file

@ -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

View file

@ -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"

View file

@ -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>

View file

@ -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 }}