Merge pull request #3126 from nourkagha/kofi-followups

🩹 Refine Ko-fi integration
This commit is contained in:
Nuno C. authored and GitHub committed 2026-11-11 18:18:50 +00:00
commit 8165cbaffc
43 files changed
+117 -9

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@ After installing (any method): delete the site's generated `hugo.toml` in the pr
All config lives in the site's `config/_default/` (reference: https://blowfish.page/docs/configuration/):
- `hugo.toml` — core Hugo settings, theme/module import, taxonomies, related-content config.
- `params.toml` — theme behavior. Key areas: `colorScheme`; `defaultAppearance`/`autoSwitchAppearance` (dark mode); `defaultBackgroundImage` + `backgroundCanvas` (site-wide fixed backdrop); `[header] layout` (`basic`, `fixed`, `fixed-fill`, `fixed-gradient`, `fixed-fill-blur`, `floating`) and `mobileMenuStyle` (`fullscreen`/`dropdown`); `[homepage] layout` (`page`, `profile`, `hero`, `card`, `background`, `landing`, `custom`) + `layoutSwitcher`; `[article]`, `[list]`, `[taxonomy]`, `[term]` display flags (hero styles, TOC, reading time/progress, breadcrumbs, `cardView`, `featureImageHover`, …); `[footer]`; search; analytics; comments; Firebase (views/likes).
- `params.toml` — theme behavior. Key areas: `colorScheme`; `defaultAppearance`/`autoSwitchAppearance` (dark mode); `defaultBackgroundImage` + `backgroundCanvas` (site-wide fixed backdrop); `[header] layout` (`basic`, `fixed`, `fixed-fill`, `fixed-gradient`, `fixed-fill-blur`, `floating`) and `mobileMenuStyle` (`fullscreen`/`dropdown`); `[homepage] layout` (`page`, `profile`, `hero`, `card`, `background`, `landing`, `custom`) + `layoutSwitcher`; `[article]`, `[list]`, `[taxonomy]`, `[term]` display flags (hero styles, TOC, reading time/progress, breadcrumbs, `cardView`, `featureImageHover`, …); `[footer]`; search; analytics; comments; support (`[buymeacoffee]`, `[kofi]`); Firebase (views/likes).
- `languages.<code>.toml` — site title, author profile (name, image, headline, bio, `links` social icons). One file per language for multilingual sites.
- `menus.<code>.toml` — `[[main]]`, `[[subnavigation]]`, and `[[footer]]` entries (`name`, `pageRef`/`url`, `weight`, optional `pre` icon).
- `markup.toml` — Goldmark config; keep `unsafe = true` (the theme relies on HTML in Markdown).
@@ -366,7 +366,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
| --- | --- | --- |
| `kofi.identifier` | _Not set_ | The identifier to the target kofi account. |
| `kofi.globalWidget` | _Not set_ | Activate the global kofi widget. |
| `kofi.globalWidgetText` | _Not set_ | Message that will be displayed the first time a new user lands on the site. |
| `kofi.globalWidgetText` | `"Sostienimi"` | The text displayed on the floating widget button. |
| `kofi.globalWidgetBackgroundColor` | `#00B9FE` | Widget background color in hex format. |
| `kofi.globalWidgetTextColor` | `#FFFFFF` | Widget text color in hex format. |
@@ -366,7 +366,7 @@ Blowfish は、テーマの機能を制御する多数の設定パラメータ
| --- | --- | --- |
| `kofi.identifier` | _未設定_ | ターゲットの Ko-fi アカウントの識別子。 |
| `kofi.globalWidget` | _未設定_ | グローバル Ko-fi ウィジェットを有効にします。 |
| `kofi.globalWidgetText` | _未設定_ | 新しいユーザーが初めてサイトにアクセスしたときに表示されるテキスト。 |
| `kofi.globalWidgetText` | `"支援する"` | フローティングウィジェットのボタンに表示されるテキスト。 |
| `kofi.globalWidgetBackgroundColor` | `#00B9FE` | ウィジェットの背景色(16進数形式)。 |
| `kofi.globalWidgetTextColor` | `#FFFFFF` | ウィジェットの文字色(16進数形式)。 |
@@ -428,7 +428,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
| --- | --- | --- |
| `kofi.identifier` | _Not set_ | The identifier to the target kofi account. |
| `kofi.globalWidget` | _Not set_ | Activate the global kofi widget. |
| `kofi.globalWidgetText` | _Not set_ | Message that will be displayed the first time a new user lands on the site. |
| `kofi.globalWidgetText` | `"Support me"` | The text displayed on the floating widget button. |
| `kofi.globalWidgetBackgroundColor` | `#00B9FE` | Widget background color in hex format. |
| `kofi.globalWidgetTextColor` | `#FFFFFF` | Widget text color in hex format. |
@@ -370,7 +370,7 @@ Blowfish 提供了大量控制主题功能的配置参数,下面的表格中
| --- | --- | --- |
| `kofi.identifier` | 无 | kofi 账户的用户名。 |
| `kofi.globalWidget` | 无 | 激活全局的 kofi 组件。 |
| `kofi.globalWidgetText` | 无 | 新用户首次访问网站时显示的消息。 |
| `kofi.globalWidgetText` | `"支持我"` | 悬浮组件按钮上显示的文本。 |
| `kofi.globalWidgetBackgroundColor` | `#00B9FE` | 组件颜色,使用 HEX 格式。 |
| `kofi.globalWidgetTextColor` | `#FFFFFF` | 组件文字颜色,使用 HEX 格式。 |
+3
View File
@@ -86,3 +86,6 @@ cookie_notice:
privacy_policy: "سياسة الخصوصية الخاصة بنا"
button: "فهمت"
image_alt: "أيقونة ملف تعريف الارتباط"
kofi:
support_me: "ادعمني"
+3
View File
@@ -86,3 +86,6 @@ cookie_notice:
privacy_policy: "политика за поверителност"
button: "Разбрах"
image_alt: "Икона на бисквитка"
kofi:
support_me: "Подкрепете ме"
+3
View File
@@ -82,3 +82,6 @@ cookie_notice:
privacy_policy: "গোপনীয়তা নীতি"
button: "বুঝেছি"
image_alt: "কুকির আইকন"
kofi:
support_me: "আমাকে সমর্থন করুন"
+3
View File
@@ -93,3 +93,6 @@ cookie_notice:
privacy_policy: "política de privacitat"
button: "Entès"
image_alt: "Icona de galeta"
kofi:
support_me: "Dóna'm suport"
+3
View File
@@ -86,3 +86,6 @@ cookie_notice:
privacy_policy: "zásady ochrany osobních údajů"
button: "Rozumím"
image_alt: "Ikona cookie"
kofi:
support_me: "Podpořte mě"
+3
View File
@@ -93,3 +93,6 @@ cookie_notice:
privacy_policy: "privatlivspolitik"
button: "Forstået"
image_alt: "Cookie-ikon"
kofi:
support_me: "Støt mig"
+3
View File
@@ -110,3 +110,6 @@ cookie_notice:
privacy_policy: "Datenschutzerklärung"
button: "Verstanden"
image_alt: "Cookie-Symbol"
kofi:
support_me: "Unterstütze mich"
+3
View File
@@ -109,3 +109,6 @@ admonition:
tip: "Tip"
todo: "Todo"
warning: "Warning"
kofi:
support_me: "Support me"
+3
View File
@@ -90,3 +90,6 @@ cookie_notice:
privacy_policy: "privatecan politikon"
button: "Komprenite"
image_alt: "Kuketa simbolo"
kofi:
support_me: "Subtenu min"
+3
View File
@@ -85,3 +85,6 @@ cookie_notice:
privacy_policy: "política de privacidad"
button: "Entendido"
image_alt: "Icono de cookie"
kofi:
support_me: "Apóyame"
+3
View File
@@ -78,3 +78,6 @@ shortcode:
recent:
show_more: "Erakutsi gehiago"
kofi:
support_me: "Lagundu nazazu"
+3
View File
@@ -92,3 +92,6 @@ cookie_notice:
privacy_policy: "سیاست حفظ حریم خصوصی ما"
button: "متوجه شدم"
image_alt: "نماد کوکی"
kofi:
support_me: "از من حمایت کنید"
+3
View File
@@ -80,3 +80,6 @@ cookie_notice:
privacy_policy: "tietosuojaselosteemme"
button: "Ymmärretty"
image_alt: "Evästeen kuvake"
kofi:
support_me: "Tue minua"
+3
View File
@@ -83,3 +83,6 @@ cookie_notice:
privacy_policy: "politique de confidentialité"
button: "Compris"
image_alt: "Icône de cookie"
kofi:
support_me: "Soutenez-moi"
+3
View File
@@ -92,3 +92,6 @@ cookie_notice:
privacy_policy: "política de privacidade"
button: "Entendido"
image_alt: "Icona de cookie"
kofi:
support_me: "Apóiame"
+3
View File
@@ -80,3 +80,6 @@ cookie_notice:
privacy_policy: "מדיניות הפרטיות שלנו"
button: "הבנתי"
image_alt: "סמל קובץ Cookie"
kofi:
support_me: "תמכו בי"
+3
View File
@@ -82,3 +82,6 @@ cookie_notice:
privacy_policy: "pravila privatnosti"
button: "Razumijem"
image_alt: "Ikona kolačića"
kofi:
support_me: "Podržite me"
+3
View File
@@ -80,3 +80,6 @@ cookie_notice:
privacy_policy: "adatvédelmi tájékoztatónkat"
button: "Rendben"
image_alt: "Süti ikon"
kofi:
support_me: "Támogass engem"
+3
View File
@@ -86,3 +86,6 @@ cookie_notice:
privacy_policy: "kebijakan privasi kami"
button: "Mengerti"
image_alt: "Ikon cookie"
kofi:
support_me: "Dukung saya"
+3
View File
@@ -97,3 +97,6 @@ cookie_notice:
privacy_policy: "informativa sulla privacy"
button: "Ho capito"
image_alt: "Icona cookie"
kofi:
support_me: "Sostienimi"
+3
View File
@@ -109,3 +109,6 @@ cookie_notice:
privacy_policy: "プライバシーポリシー"
button: "了解しました"
image_alt: "Cookie アイコン"
kofi:
support_me: "支援する"
+3
View File
@@ -86,3 +86,6 @@ cookie_notice:
privacy_policy: "개인정보 처리방침"
button: "확인했습니다"
image_alt: "쿠키 아이콘"
kofi:
support_me: "후원하기"
+3
View File
@@ -102,3 +102,6 @@ admonition:
tip: "Tips"
todo: "Gjøremål"
warning: "Advarsel"
kofi:
support_me: "Støtt meg"
+3
View File
@@ -88,3 +88,6 @@ cookie_notice:
privacy_policy: "privacybeleid"
button: "Begrepen"
image_alt: "Cookie-pictogram"
kofi:
support_me: "Steun mij"
+3
View File
@@ -87,3 +87,6 @@ cookie_notice:
privacy_policy: "politykę prywatności"
button: "Rozumiem"
image_alt: "Ikona pliku cookie"
kofi:
support_me: "Wesprzyj mnie"
+3
View File
@@ -83,3 +83,6 @@ cookie_notice:
privacy_policy: "política de privacidade"
button: "Entendi"
image_alt: "Ícone de cookie"
kofi:
support_me: "Me apoie"
+3
View File
@@ -83,3 +83,6 @@ cookie_notice:
privacy_policy: "política de privacidade"
button: "Compreendi"
image_alt: "Ícone de cookie"
kofi:
support_me: "Apoie-me"
+3
View File
@@ -80,3 +80,6 @@ cookie_notice:
privacy_policy: "politica noastră de confidențialitate"
button: "Am înțeles"
image_alt: "Pictogramă cookie"
kofi:
support_me: "Susține-mă"
+3
View File
@@ -86,3 +86,6 @@ cookie_notice:
privacy_policy: "политикой конфиденциальности"
button: "Понятно"
image_alt: "Значок cookie"
kofi:
support_me: "Поддержите меня"
+3
View File
@@ -80,3 +80,6 @@ cookie_notice:
privacy_policy: "integritetspolicy"
button: "Förstått"
image_alt: "Cookie-ikon"
kofi:
support_me: "Stöd mig"
+3
View File
@@ -91,3 +91,6 @@ cookie_notice:
privacy_policy: "นโยบายความเป็นส่วนตัวของเรา"
button: "เข้าใจแล้ว"
image_alt: "ไอคอนคุกกี้"
kofi:
support_me: "สนับสนุน"
+3
View File
@@ -76,3 +76,6 @@ cookie_notice:
privacy_policy: "Gizlilik Politikamız"
button: "Anladım"
image_alt: "Çerez simgesi"
kofi:
support_me: "Beni destekle"
+3
View File
@@ -93,3 +93,6 @@ cookie_notice:
privacy_policy: "політикою конфіденційності"
button: "Зрозуміло"
image_alt: "Значок cookie"
kofi:
support_me: "Підтримайте мене"
+3
View File
@@ -89,3 +89,6 @@ cookie_notice:
privacy_policy: "chính sách quyền riêng tư của chúng tôi"
button: "Đã hiểu"
image_alt: "Biểu tượng cookie"
kofi:
support_me: "Ủng hộ tôi"
+3
View File
@@ -109,3 +109,6 @@ cookie_notice:
privacy_policy: "隐私政策"
button: "明白了"
image_alt: "Cookie 图标"
kofi:
support_me: "支持我"
+3
View File
@@ -109,3 +109,6 @@ cookie_notice:
privacy_policy: "隱私權政策"
button: "了解了"
image_alt: "Cookie 圖示"
kofi:
support_me: "支持我"
+2 -2
View File
@@ -74,12 +74,12 @@
data-x_margin="18"
data-y_margin="18"></script>
{{ end }}
{{ if site.Params.kofi.globalWidget | default false }}
{{ if and (site.Params.kofi.globalWidget | default false) site.Params.kofi.identifier }}
<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.text': '{{ cond (isset site.Params.kofi "globalwidgettext") site.Params.kofi.globalWidgetText (i18n "kofi.support_me") }}',
'floating-chat.donateButton.background-color': '{{ site.Params.kofi.globalWidgetBackgroundColor | default "#00B9FE" }}',
'floating-chat.donateButton.text-color': '{{ site.Params.kofi.globalWidgetTextColor | default "#FFFFFF" }}',
});
+2 -2
View File
@@ -1,12 +1,12 @@
{{ $isRTL := .Site.Params.rtl | default false }}
{{ $coffeeIsRight := and (eq (lower site.Params.buymeacoffee.globalWidgetPosition) "right") .Site.Params.buymeacoffee.globalWidget }}
{{ $coffeeIsRight := and (eq (lower .Site.Params.buymeacoffee.globalWidgetPosition) "right") .Site.Params.buymeacoffee.globalWidget }}
{{ if not $coffeeIsRight }}
{{ $coffeeIsRight = false }}
{{ end }}
{{ $needAvoidCoffee := ne $coffeeIsRight $isRTL }}
{{ $kofiEnabled := .Site.Params.kofi.globalWidget | default false }}
{{ $kofiEnabled := and (.Site.Params.kofi.globalWidget | default false) .Site.Params.kofi.identifier }}
{{ $needAvoidKofi := and $kofiEnabled $isRTL }}
{{ $needExtraOffset := or $needAvoidCoffee $needAvoidKofi }}