diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index ac72339..4ed245e 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -31,6 +31,13 @@ utterancesTheme = "" # optional utterancesIssue = "" # optional utterancesLabel = "" # optional +# Giscus support +GiscusRepo = "" # mandatory +GiscusRepoId = "" # mandatory +GiscusCategory = "Announcements" # mandatory +GiscusCategoryId = "" # mandatory +GiscusLazyLoad = false # optional + [[params.social]] id = "docs" url = "https://gohugo.io/documentation/" diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index 079e0f9..e58321f 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -13,3 +13,7 @@ {{ if .Site.Params.graphcommentId }} {{ partial "graphcomment.html" . }} {{ end }} + +{{ if .Site.Params.GiscusRepo}} + {{ partial "giscus.html" . }} +{{ end}} \ No newline at end of file diff --git a/layouts/partials/giscus.html b/layouts/partials/giscus.html new file mode 100644 index 0000000..b879c18 --- /dev/null +++ b/layouts/partials/giscus.html @@ -0,0 +1,24 @@ +{{ $theme := .Site.Params.GiscusTheme | default "preferred_color_scheme" }} +{{ $mapping := .Site.Params.GiscusDataMapping | default "og:title" }} +{{ $language := .Site.Params.GiscusLang | default "en" }} +{{ $category := .Site.Params.GiscusDiscussionCategory | default "Announcements" }} +{{ $lazyload := .Site.Params.GiscusLazyLoad | default false }} + + \ No newline at end of file