Browse Source

Add commento (#178)

* feat: add commento block

Signed-off-by: Kirill K <kovalev.kirill.a@gmail.com>

* fix: use params section in config example

Signed-off-by: Kirill K <kovalev.kirill.a@gmail.com>

* fix: use defer to execute script after page load

Signed-off-by: Kirill K <kovalev.kirill.a@gmail.com>
tags/2.45
Kirill K 5 years ago
parent
commit
a460bf8838
3 changed files with 18 additions and 6 deletions
  1. 9
    4
      README.md
  2. 7
    2
      layouts/_default/single.html
  3. 2
    0
      layouts/partials/commento.html

+ 9
- 4
README.md View File



- Responsive - Responsive
- Accessible - Accessible
- Contact form
- Contact form
- Custom Robots.txt (changes values based on environment) - 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 - RSS Discovery
- Table of Contents (must declare `toc: true` in post parameter) - Table of Contents (must declare `toc: true` in post parameter)




### Add comments ### 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 ### Change the hero background



+ 7
- 2
layouts/_default/single.html View File

{{/* Hugo uses Go's date formatting is set by example. Here are two formats */}} {{/* 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" }}"> <time class="f6 mv4 dib tracked" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{- .Date.Format "January 2, 2006" -}} {{- .Date.Format "January 2, 2006" -}}
</time>
{{/*
</time>
{{/*
Show "reading time" and "word count" but only if one of the following are true: 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` 1) A global config `params` value is set `show_reading_time = true`
2) A section front matter value is set `show_reading_time = true` 2) A section front matter value is set `show_reading_time = true`
{{- .Content -}} {{- .Content -}}
{{- partial "tags.html" . -}} {{- partial "tags.html" . -}}
<div class="mt6"> <div class="mt6">
{{ if .Site.DisqusShortname }}
{{ template "_internal/disqus.html" . }} {{ template "_internal/disqus.html" . }}
{{ end }}
{{ if .Site.Params.commentoEnable }}
{{- partial "commento.html" . -}}
{{ end }}
</div> </div>
</section> </section>



+ 2
- 0
layouts/partials/commento.html View File

<div id="commento"></div>
<script defer src="https://cdn.commento.io/js/commento.js"></script>

Loading…
Cancel
Save