From adf5a113fc219e557624514bf35484e3746cc9e5 Mon Sep 17 00:00:00 2001 From: Xin Date: Tue, 26 Sep 2023 22:12:38 +0100 Subject: [PATCH] fix: giscus theme and language display issues (#95) * chore: minor update giscus template * fix: theme toggle should select all * chore: example configs for giscus * fix: language code in giscus --- exampleSite/hugo.yaml | 18 ++++++++++++++++++ layouts/partials/components/giscus.html | 14 ++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index 56141312..3dd11189 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -26,6 +26,7 @@ languages: title: "Hextra テーマ" zh-cn: languageName: 简体中文 + languageCode: zh-CN weight: 3 title: Hextra @@ -122,3 +123,20 @@ params: editURL: enable: true base: "https://github.com/imfing/hextra/edit/main/exampleSite/content" + + comment: + enable: false + type: giscus + + # https://giscus.app/ + giscus: + repo: "imfing/hextra" + repoId: "R_kgDOJ9fJag" + category: "General" + categoryId: "DIC_kwDOJ9fJas4CY7gW" + # mapping: "pathname" + # strict: 0 + # reactionsEnabled: 1 + # emitMetadata: 0 + # inputPosition: "top" + # lang: "en" diff --git a/layouts/partials/components/giscus.html b/layouts/partials/components/giscus.html index 1ea3dc87..a0aeb578 100644 --- a/layouts/partials/components/giscus.html +++ b/layouts/partials/components/giscus.html @@ -1,6 +1,6 @@ -{{- with site.Params.comment.giscus -}} +{{- $lang := site.Language.LanguageCode | default `en` -}} -{{- $lang = site.Language.Lang | default `en` -}} +{{- with site.Params.comment.giscus -}} +
{{- end -}}