Add support for Utterances comments

This commit is contained in:
Morgan Creekmore 2018-11-01 22:17:45 -05:00
parent d62ce18b7b
commit c5139fca26
No known key found for this signature in database
GPG key ID: 0A7464E68B129EB1
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)
* `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

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
#UtterancesIssueTheme = "..." # 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="{{ .Site.Params.UtterancesIssueTheme }}"
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 }}