Skip to content

Commit

Permalink
Add commento (#178)
Browse files Browse the repository at this point in the history
* feat: add commento block

Signed-off-by: Kirill K <[email protected]>

* fix: use params section in config example

Signed-off-by: Kirill K <[email protected]>

* fix: use defer to execute script after page load

Signed-off-by: Kirill K <[email protected]>
  • Loading branch information
agrrh authored and Bud Parr committed Jun 9, 2019
1 parent 0e3fd73 commit a460bf8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Features

- Responsive
- Accessible
- Contact form
- Contact form
- Custom Robots.txt (changes values based on environment)
- Internal templates for meta data, google analytics, and DISQUS comments
- Internal templates for meta data, google analytics, and DISQUS or COMMENTO comments
- RSS Discovery
- Table of Contents (must declare `toc: true` in post parameter)

Expand Down Expand Up @@ -71,9 +71,14 @@ You may need to delete the line: `themesDir = "../.."`

### Add comments

To enable DISQUS comments, add `disqusShortname = YOURSHORTNAME` to your config file.

To enable comments, add following to your config file:

- DISQUS: `disqusShortname = YOURSHORTNAME`
- COMMENTO:
```
[params]
commentoEnable = true`
```

### Change the hero background

Expand Down
9 changes: 7 additions & 2 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ <h1 class="f1 athelas mb1">
{{/* Hugo uses Go's date formatting is set by example. Here are two formats */}}
<time class="f6 mv4 dib tracked" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{- .Date.Format "January 2, 2006" -}}
</time>
{{/*
</time>
{{/*
Show "reading time" and "word count" but only if one of the following are true:
1) A global config `params` value is set `show_reading_time = true`
2) A section front matter value is set `show_reading_time = true`
Expand All @@ -38,7 +38,12 @@ <h1 class="f1 athelas mb1">
{{- .Content -}}
{{- partial "tags.html" . -}}
<div class="mt6">
{{ if .Site.DisqusShortname }}
{{ template "_internal/disqus.html" . }}
{{ end }}
{{ if .Site.Params.commentoEnable }}
{{- partial "commento.html" . -}}
{{ end }}
</div>
</section>

Expand Down
2 changes: 2 additions & 0 deletions layouts/partials/commento.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<div id="commento"></div>
<script defer src="https://cdn.commento.io/js/commento.js"></script>

0 comments on commit a460bf8

Please sign in to comment.