From ecefb45ae16300701b4873940030f1f717a4adad Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 15 Aug 2021 09:59:13 +0000 Subject: [PATCH] Add reactionsEnabled and emitMetadata config for giscuss + Format code --- exampleSite/config.yaml | 20 +++++++------- .../partials/comments/provider/giscus.html | 27 +++++++++++-------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 12c5cd0..425a142 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -94,13 +94,15 @@ params: lang: giscus: - repo: - repoID: - category: - categoryID: - mapping: - lightTheme: - darkTheme: + repo: + repoID: + category: + categoryID: + mapping: + lightTheme: + darkTheme: + reactionsEnabled: 1 + emitMetadata: 0 widgets: enabled: @@ -152,8 +154,8 @@ menu: weight: -100 pre: home params: - ### For demonstration purpose, the home link will be open in a new tab - newTab: true + ### For demonstration purpose, the home link will be open in a new tab + newTab: true related: includeNewer: true diff --git a/layouts/partials/comments/provider/giscus.html b/layouts/partials/comments/provider/giscus.html index ff13e9b..f36ead9 100644 --- a/layouts/partials/comments/provider/giscus.html +++ b/layouts/partials/comments/provider/giscus.html @@ -5,40 +5,45 @@ data-repo-id="{{- .repoID -}}" data-category="{{- .category -}}" data-category-id="{{- .categoryID -}}" - data-mapping="{{- default "title" .mapping -}}" - data-reactions-enabled="1" - data-emit-metadata="0" - data-theme="{{- default "light" .lightTheme -}}" + data-mapping="{{- default `title` .mapping -}}" + data-reactions-enabled="{{- default 1 .reactionsEnabled -}}" + data-emit-metadata="{{- default 0 .emitMetadata -}}" + data-theme="{{- default `light` .lightTheme -}}" crossorigin="anonymous" async > {{- end -}}