add comments via utterances

This commit is contained in:
John Bowdre 2023-08-21 16:42:59 -05:00
parent eca1287520
commit 9dd3a8ac58
4 changed files with 28 additions and 0 deletions

View file

@ -4,6 +4,12 @@ description = "while (true) { bugs++; }"
mainSections = ["posts"] mainSections = ["posts"]
fallBackOgImage = "images/broken-computer.svg" fallBackOgImage = "images/broken-computer.svg"
# Comments
comments = true
utterancesRepo = "jbowdre/runtimeterror"
utterancesIssueTerm = "title"
utterancesTheme = "gruvbox-dark"
[theme] [theme]
palette = "runtimeterror" palette = "runtimeterror"

View file

@ -5,6 +5,7 @@ date = "2019-02-28"
aliases = ["about-us", "about-hugo", "contact"] aliases = ["about-us", "about-hugo", "contact"]
author = "Hugo Authors" author = "Hugo Authors"
timeless = "true" timeless = "true"
comments = false
+++ +++
Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.

View file

@ -20,6 +20,15 @@
<div class="content__body"> <div class="content__body">
{{ .Content }} {{ .Content }}
</div> </div>
{{- $showComments := true }}
{{- if eq .Site.Params.comments false }}
{{- $showComments = false }}
{{- else if eq .Params.comments false }}
{{- $showComments = false }}
{{- end }}
{{- if ne $showComments false }}
{{- partial "comments" . }}
{{- end }}
<footer class="content__footer"></footer> <footer class="content__footer"></footer>
{{ end }} {{ end }}

View file

@ -0,0 +1,12 @@
{{ if .Site.Params.utterancesRepo }}
<br>
<div class="post_comments">
<script src="https://utteranc.es/client.js"
repo="{{.Site.Params.utterancesRepo}}"
issue-term="{{.Site.Params.utterancesIssueTerm | default "pathname"}}"
theme="{{.Site.Params.utterancesTheme | default "github-dark-orange"}}"
crossorigin="anonymous"
async>
</script>
</div>
{{ end }}