Merge pull request #2562 from ZhenShuo2021/fix/scroll-to-top

🐛 Fix(scroll-to-top): handle nil value correctly
This commit is contained in:
Nuno C. authored and GitHub committed 2025-11-03 22:13:12 +00:00
commit 998aee7bf3
1 file changed
+5 -1
+5 -1
View File
@@ -1,5 +1,9 @@
{{ $coffeeIsRight := and .Site.Params.buymeacoffee.globalWidget (eq (lower site.Params.buymeacoffee.globalWidgetPosition) "right") }}
{{ $isRTL := .Site.Params.rtl | default false }}
{{ $coffeeIsRight := and (eq (lower site.Params.buymeacoffee.globalWidgetPosition) "right") .Site.Params.buymeacoffee.globalWidget }}
{{ if not $coffeeIsRight }}
{{ $coffeeIsRight = false }}
{{ end }}
{{ $needAvoidCoffee := ne $coffeeIsRight $isRTL }}
{{ $toTopYOffset := cond $needAvoidCoffee "bottom-24" "bottom-6" }}