✨ Add Ko-fi integration

This commit is contained in:
Nour Agha committed 2026-10-01 00:54:48 +03:00
1 parent a062452786
commit bfc49a8e13
20 files changed
+94 -22

No files matched your search

+11
View File
@@ -74,4 +74,15 @@
data-x_margin="18"
data-y_margin="18"></script>
{{ end }}
{{ if site.Params.kofi.globalWidget | default false }}
<script src="https://storage.ko-fi.com/cdn/scripts/overlay-widget.js"></script>
<script>
kofiWidgetOverlay.draw('{{ site.Params.kofi.identifier }}', {
'type': 'floating-chat',
'floating-chat.donateButton.text': '{{ site.Params.kofi.globalWidgetText | default "" }}',
'floating-chat.donateButton.background-color': '{{ site.Params.kofi.globalWidgetBackgroundColor | default "#00B9FE" }}',
'floating-chat.donateButton.text-color': '{{ site.Params.kofi.globalWidgetTextColor | default "#FFFFFF" }}',
});
</script>
{{ end }}
</html>
+5 -1
View File
@@ -5,8 +5,12 @@
{{ end }}
{{ $needAvoidCoffee := ne $coffeeIsRight $isRTL }}
{{ $toTopYOffset := cond $needAvoidCoffee "bottom-24" "bottom-6" }}
{{ $kofiEnabled := .Site.Params.kofi.globalWidget | default false }}
{{ $needAvoidKofi := and $kofiEnabled $isRTL }}
{{ $needExtraOffset := or $needAvoidCoffee $needAvoidKofi }}
{{ $toTopYOffset := cond $needExtraOffset "bottom-24" "bottom-6" }}
<div
id="scroll-to-top"