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.
2025-11-03 22:13:12 +00:00
committed by GitHub

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" }}