Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Utterances comments #50

Merged
merged 2 commits into from
Nov 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}