From 06aa627d3c8b828182a97ff69987a4c5bf6d01eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A0s=20Civil?= <70479573+BernatBC@users.noreply.github.com> Date: Wed, 21 May 2025 12:25:11 +0200 Subject: [PATCH 1/3] fix(article): date translation on compact mode (#1149) * Fix translation * Revert jsconfig --- layouts/partials/article-list/compact.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/article-list/compact.html b/layouts/partials/article-list/compact.html index 376512a..f2784d6 100644 --- a/layouts/partials/article-list/compact.html +++ b/layouts/partials/article-list/compact.html @@ -6,7 +6,7 @@ From d9acd770152f11ffc22abdf1a9d5723ab07669df Mon Sep 17 00:00:00 2001 From: Lparksi <60086490+Lparksi@users.noreply.github.com> Date: Wed, 21 May 2025 18:31:22 +0800 Subject: [PATCH 2/3] feat(comment/waline): add support for Waline's turnstileKey (#1140) * fix: Added support for waline's turnstileKey * style: remove extra space in waline.html --- layouts/partials/comments/provider/waline.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/comments/provider/waline.html b/layouts/partials/comments/provider/waline.html index 9d1a2a0..30a09eb 100644 --- a/layouts/partials/comments/provider/waline.html +++ b/layouts/partials/comments/provider/waline.html @@ -16,7 +16,7 @@ {{- with .Site.Params.comments.waline -}} {{- $config := dict "el" "#waline" "dark" `html[data-scheme="dark"]` -}} -{{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "imageuploader" "imageUploader" "texrenderer" "texRenderer" -}} +{{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "imageuploader" "imageUploader" "texrenderer" "texRenderer" "turnstilekey" "turnstileKey" -}} {{- range $key, $val := . -}} {{- if ne $val nil -}} From 47832083d8669f7269a6a301f79eb44247a9a5d0 Mon Sep 17 00:00:00 2001 From: "Gleb A." <94681073+gleb-kun@users.noreply.github.com> Date: Wed, 21 May 2025 13:52:47 +0300 Subject: [PATCH 3/3] refactor(comments): use `includes` instead of `indexOf` to improve readability (#1128) * fix(disqusjs): refactor local DisqusJS loading check for improved readability * fix(gitalk): refactor local Gitalk loading check for improved readability --- layouts/partials/comments/provider/disqusjs.html | 8 ++++++-- layouts/partials/comments/provider/gitalk.html | 7 ++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/layouts/partials/comments/provider/disqusjs.html b/layouts/partials/comments/provider/disqusjs.html index 967c38c..f4f4c03 100644 --- a/layouts/partials/comments/provider/disqusjs.html +++ b/layouts/partials/comments/provider/disqusjs.html @@ -21,8 +21,12 @@ } function lazyLoadDisqusJS() { - if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) { - document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.'; + const excludedHosts = ["localhost", "127.0.0.1"]; + const hostname = window.location.hostname; + + if (excludedHosts.includes(hostname)) { + document.getElementById('disqus_thread').innerHTML = + 'Disqus comments not available by default when the website is previewed locally.'; return; } diff --git a/layouts/partials/comments/provider/gitalk.html b/layouts/partials/comments/provider/gitalk.html index 54bfcba..ac77fc6 100644 --- a/layouts/partials/comments/provider/gitalk.html +++ b/layouts/partials/comments/provider/gitalk.html @@ -18,9 +18,10 @@ proxy: {{- .proxy -}}, }); (function () { - if ( - ["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1 - ) { + const excludedHosts = ["localhost", "127.0.0.1"]; + const hostname = window.location.hostname; + + if (excludedHosts.includes(hostname)) { document.getElementById("gitalk-container").innerHTML = "Gitalk comments not available by default when the website is previewed locally."; return;