Skip to content

Commit

Permalink
Add Giscus Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel-Roberts committed Jul 2, 2024
1 parent 499fb98 commit 83aff87
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
16 changes: 15 additions & 1 deletion hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,18 @@ url = "about/"
[[menu.main]]
name = "Contact Me"
weight = 4
url = "contact/"
url = "contact/"

# Comments
[params.giscus]
repo = "Nathaniel-Roberts/Nathaniel-Roberts.github.io"
repoID = "R_kgDOI1dzaQ"
category = "Announcements"
categoryID = "DIC_kwDOI1dzac4Cgh9i"
mapping = "pathname"
reactionsEnabled = "1"
emitMetadata = "0"
inputPosition = "top"
theme = "noborder_dark"
lang = "en"
loading = "lazy"
19 changes: 19 additions & 0 deletions layouts/posts/giscus.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if isset .Site.Params "giscus" -}}
{{- if and (isset .Site.Params.giscus "repo") (not (eq .Site.Params.giscus.repo "" )) (eq (.Params.disable_comments | default false) false) -}}
<script src="https://giscus.app/client.js"
data-repo="{{ .Site.Params.giscus.repo }}"
data-repo-id="{{ .Site.Params.giscus.repoID }}"
data-category="{{ .Site.Params.giscus.category }}"
data-category-id="{{ .Site.Params.giscus.categoryID }}"
data-mapping="{{ default "pathname" .Site.Params.giscus.mapping }}"
data-reactions-enabled="{{ default "1" .Site.Params.giscus.reactionsEnabled }}"
data-emit-metadata="{{ default "0" .Site.Params.giscus.emitMetadata }}"
data-input-position="{{ default "bottom" .Site.Params.giscus.inputPosition }}"
data-theme="{{ default "light" .Site.Params.giscus.theme }}"
data-lang="{{ default "en" .Site.Params.giscus.lang }}"
data-loading="{{ default "lazy" .Site.Params.giscus.loading }}"
crossorigin="anonymous"
async>
</script>
{{- end -}}
{{- end -}}
3 changes: 3 additions & 0 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<footer>
{{ partial "posts/giscus.html" . }}
</footer>

0 comments on commit 83aff87

Please sign in to comment.