From 655b5102c4caffb76f38c68d353b992de036b007 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Thu, 28 Jul 2022 16:48:37 +0000 Subject: [PATCH 01/22] fix(article): footnote reference does not work closes https://github.com/CaiJimmy/hugo-theme-stack/issues/632 --- assets/ts/smoothAnchors.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/assets/ts/smoothAnchors.ts b/assets/ts/smoothAnchors.ts index 379eb39..46a4a03 100644 --- a/assets/ts/smoothAnchors.ts +++ b/assets/ts/smoothAnchors.ts @@ -21,12 +21,15 @@ function setupSmoothAnchors() { aElement.addEventListener("click", clickEvent => { clickEvent.preventDefault(); - let targetId = aElement.getAttribute("href").substring(1); - // The replace done on ':' is here for footnotes, as this character would otherwise interfere when used as a CSS selector. - let target = document.getElementById(targetId.replace(":", "\\:")) as HTMLElement; + const targetId = aElement.getAttribute("href").substring(1), + target = document.getElementById(targetId) as HTMLElement, + offset = target.getBoundingClientRect().top - document.documentElement.getBoundingClientRect().top; window.history.pushState({}, "", aElement.getAttribute("href")); - scrollTo({ top: target.offsetTop, behavior: "smooth" }); + scrollTo({ + top: offset, + behavior: "smooth" + }); }); }); } From d00dbc17bc1e8f12557f049127d279e00d5e11ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9B=E5=B7=B3=E6=B5=81=E7=81=AB?= <59004461+ambition-echo@users.noreply.github.com> Date: Sun, 31 Jul 2022 18:39:20 +0800 Subject: [PATCH 02/22] feat(comment): add `strict` and `input-position` to Giscus config (#648) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 添加giscus设置选项 根据giscus官方文档,添加了data-strict和data-input-position设置选项 * feat: add strict and inputPosition to giscus config section Co-authored-by: Jimmy Cai --- config.yaml | 2 ++ layouts/partials/comments/provider/giscus.html | 2 ++ 2 files changed, 4 insertions(+) diff --git a/config.yaml b/config.yaml index 93367bb..fcb4bcb 100644 --- a/config.yaml +++ b/config.yaml @@ -92,10 +92,12 @@ params: category: categoryID: mapping: + strict: lightTheme: darkTheme: reactionsEnabled: 1 emitMetadata: 0 + inputPosition: lang: gitalk: diff --git a/layouts/partials/comments/provider/giscus.html b/layouts/partials/comments/provider/giscus.html index abe345f..f7f435d 100644 --- a/layouts/partials/comments/provider/giscus.html +++ b/layouts/partials/comments/provider/giscus.html @@ -6,8 +6,10 @@ data-category="{{- .category -}}" data-category-id="{{- .categoryID -}}" data-mapping="{{- default `title` .mapping -}}" + data-strict="{{- default 0 .strict -}}" data-reactions-enabled="{{- default 1 .reactionsEnabled -}}" data-emit-metadata="{{- default 0 .emitMetadata -}}" + data-input-position="{{- default `top` .inputPosition -}}" data-theme="{{- default `light` .lightTheme -}}" data-lang="{{- default `en` .lang -}}" crossorigin="anonymous" From 5869a7ab83aaff19393433f0547d1db40ca437da Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 31 Jul 2022 10:55:27 +0000 Subject: [PATCH 03/22] release: 3.13.0 --- layouts/partials/footer/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index 09adc9d..255eba5 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -1,4 +1,4 @@ -{{- $ThemeVersion := "3.12.0" -}} +{{- $ThemeVersion := "3.13.0" -}}