From 03f078ba8eb3605d2de75c08c8721e4898b837da Mon Sep 17 00:00:00 2001 From: ZhenShuo Leo <98386542+ZhenShuo2021@users.noreply.github.com> Date: Thu, 16 Oct 2025 00:40:53 +0800 Subject: [PATCH] fix(scroll-to-top): handle nil value correctly --- layouts/partials/scroll-to-top.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/layouts/partials/scroll-to-top.html b/layouts/partials/scroll-to-top.html index bf56a314..f05d7231 100644 --- a/layouts/partials/scroll-to-top.html +++ b/layouts/partials/scroll-to-top.html @@ -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" }}