Skip to content

Commit 890f669

Browse files
authored
add utterances comments support (daattali#596)
1 parent a04be27 commit 890f669

5 files changed

Lines changed: 29 additions & 0 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,17 @@ To use Disqus, simply sign up to [Disqus](https://disqus.com/) and add your Disq
114114

115115
To use Facebook comments, create a Facebook app using [Facebook developers](https://developers.facebook.com/docs/apps/register), and add the Facebook App ID to the `fb_comment_id` parameter in `_config.yml`.
116116

117+
#### Utterances comments
118+
119+
To use [Utterances comments](https://utteranc.es/), follow these steps: (1) Enable Issues in your GitHub repository, (2) Install the Utterances app in your repository (go to https://github.com/apps/utterances), (3) Fill in the `repository` parameter in the utterances section of the `_config.yml` file.
120+
117121
#### Staticman comments
118122

119123
To use Staticman, you first need to invite `staticmanlab` as a collaborator to your repository (by going to your repository **Settings** page, navigate to the **Collaborators** tab, and add the username `staticmanlab`), and then accept the invitation by going to `https://staticman3.herokuapp.com/v3/connect/github/<username>/<repo-name>`. Lastly, fill in the `staticman` parameters in the Staticman section of `_config.yml`. You may also choose a different Staticman instance other than `staticmanlab`.
120124

121125
Optional: You may want to configure a webhook to prevent old inactive branches (representing approved comments) from stacking up. You can refer to [Staticman's documentation](https://staticman.net/docs/webhooks) for details. Make sure to input the **Payload URL** according to your chosen `endpoint`. For example, the default `endpoint` is `https://staticman3.herokuapp.com/v3/entry/github/`, so the corresponding **Payload URL** should be `https://staticman3.herokuapp.com/v1/webhook`.
122126

127+
123128
### Adding Google Analytics to track page views
124129

125130
Beautiful Jekyll lets you easily add Google Analytics to all your pages. This will let you track all sorts of information about visits to your website, such as how many times each page is viewed and where (geographically) your users come from. To add Google Analytics, simply sign up to [Google Analytics](https://www.google.com/analytics/) to obtain your Google Tracking ID, and add this tracking ID to the `google_analytics` parameter in `_config.yml`.

_config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@ staticman:
134134
siteKey : # Use your own site key, you need to apply for one on Google
135135
secret : # ENCRYPT your password by going to https://staticman3.herokuapp.com/v3/encrypt/<your-site-secret>
136136

137+
# To use Utterances comments: (1) fill in repository (make sure the repository is public), (2) Enable Issues in your repository, (3) Install the Utterances app in your repository https://github.com/apps/utterances
138+
# See more details about the parameters below at https://utteranc.es/
139+
utterances:
140+
repository: # GitHub username/repository eg. "daattali/beautiful-jekyll"
141+
issue-term: title # Mapping between blog posts and GitHub issues
142+
theme: github-light # Utterances theme
143+
label: blog-comments # Label that will be assigned to GitHub Issues created by Utterances
144+
145+
137146
# --- Misc --- #
138147

139148
# Facebook App ID

_includes/utterances-comment.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% if site.utterances.repo and site.utterances.issue-term %}
2+
3+
<script src="https://utteranc.es/client.js"
4+
repository="{{site.utterances.repo }}"
5+
issue-term="{{ site.utterances.issue-term }}"
6+
theme="{{ site.utterances.theme}}"
7+
label="{{ site.utterances.label}}"
8+
crossorigin="anonymous"
9+
async>
10+
</script>
11+
12+
{% endif %}
13+

_layouts/page.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<div class="staticman-comments">
1717
{% include staticman-comments.html %}
1818
</div>
19+
{% include utterances-comment.html %}
1920
{% endif %}
2021
</div>
2122
</div>

_layouts/post.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
<div class="staticman-comments">
7474
{% include staticman-comments.html %}
7575
</div>
76+
{% include utterances-comment.html %}
7677
{% endif %}
7778
</div>
7879
</div>

0 commit comments

Comments
 (0)