From decf0fe9d3193c31aa6445e1da2296d2a6a3c3fa Mon Sep 17 00:00:00 2001 From: razonyang Date: Fri, 16 Jun 2023 10:02:15 +0800 Subject: [PATCH] feat(funding): add support for Buy Me a Coffee --- exampleSite/config/_default/params.toml | 1 + exampleSite/content/docs/widgets/funding/index.md | 1 + exampleSite/content/docs/widgets/funding/index.zh-hans.md | 1 + exampleSite/content/docs/widgets/funding/index.zh-hant.md | 1 + i18n/ar.toml | 3 +++ i18n/de.toml | 3 +++ i18n/en.toml | 3 +++ i18n/pl.toml | 3 +++ i18n/zh-cn.toml | 3 +++ i18n/zh-hans.toml | 3 +++ i18n/zh-hant.toml | 3 +++ i18n/zh-hk.toml | 3 +++ i18n/zh-tw.toml | 3 +++ layouts/partials/post/panel/funding.html | 3 ++- 14 files changed, 33 insertions(+), 1 deletion(-) diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 1a7b9c2e..8c1e3f70 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -211,6 +211,7 @@ minMatchCharLength = 3 [funding] alipay = "https://razonyang.com/images/reward/alipay.webp" wechat = "https://razonyang.com/images/reward/wechat.webp" +buymeacoffee = "razonyang" ko_fi = "razonyang" patreon = "razonyang" open_collective = "hbs" diff --git a/exampleSite/content/docs/widgets/funding/index.md b/exampleSite/content/docs/widgets/funding/index.md index 0c6af055..e97b6d03 100644 --- a/exampleSite/content/docs/widgets/funding/index.md +++ b/exampleSite/content/docs/widgets/funding/index.md @@ -39,6 +39,7 @@ The `funding` is a key value pair that mapping from platform to their QR Code im | `funding.ko_fi` | String | - | Ko-fi username. | `funding.patreon` | String | - | Patreon username. | `funding.open_collective` | String | - | Open Collective username. +| `funding.buymeacoffee` | String | - | Buy Me a Coffee username. ## Page Parameter diff --git a/exampleSite/content/docs/widgets/funding/index.zh-hans.md b/exampleSite/content/docs/widgets/funding/index.zh-hans.md index b0813819..57c2f761 100644 --- a/exampleSite/content/docs/widgets/funding/index.zh-hans.md +++ b/exampleSite/content/docs/widgets/funding/index.zh-hans.md @@ -38,6 +38,7 @@ authors = ["RazonYang"] | `funding.ko_fi` | String | - | Ko-fi 用户名。 | `funding.patreon` | String | - | Patreon 用户名。 | `funding.open_collective` | String | - | Open Collective 用户名。 +| `funding.buymeacoffee` | String | - | Buy Me a Coffee 用户名。 ## 页面配置 diff --git a/exampleSite/content/docs/widgets/funding/index.zh-hant.md b/exampleSite/content/docs/widgets/funding/index.zh-hant.md index 7cee69c2..17448fae 100644 --- a/exampleSite/content/docs/widgets/funding/index.zh-hant.md +++ b/exampleSite/content/docs/widgets/funding/index.zh-hant.md @@ -38,6 +38,7 @@ authors = ["RazonYang"] | `funding.ko_fi` | String | - | Ko-fi 用戶名。 | `funding.patreon` | String | - | Patreon 用戶名。 | `funding.open_collective` | String | - | Open Collective 用戶名。 +| `funding.buymeacoffee` | String | - | Buy Me a Coffee 用戶名。 ## 頁面配置 diff --git a/i18n/ar.toml b/i18n/ar.toml index a39dc535..6315def9 100644 --- a/i18n/ar.toml +++ b/i18n/ar.toml @@ -151,6 +151,9 @@ other = "صغير جدا" [funding_alipay] other = "علي باي" +[funding_buymeacoffee] +other = "Buy Me a Coffee" + [funding_ko_fi] other = "Ko-fi" diff --git a/i18n/de.toml b/i18n/de.toml index 6139f070..22b9f8f7 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -151,6 +151,9 @@ other = "Extra klein" [funding_alipay] other = "Alipay" +[funding_buymeacoffee] +other = "Buy Me a Coffee" + [funding_ko_fi] other = "Ko-fi" diff --git a/i18n/en.toml b/i18n/en.toml index f34aa649..2a7016d6 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -151,6 +151,9 @@ other = "Extra Small" [funding_alipay] other = "Alipay" +[funding_buymeacoffee] +other = "Buy Me a Coffee" + [funding_ko_fi] other = "Ko-fi" diff --git a/i18n/pl.toml b/i18n/pl.toml index 01d729dd..0f7a0df9 100644 --- a/i18n/pl.toml +++ b/i18n/pl.toml @@ -151,6 +151,9 @@ other = "Bardzo mały" [funding_alipay] other = "Alipay" +[funding_buymeacoffee] +other = "Buy Me a Coffee" + [funding_ko_fi] other = "Ko-fi" diff --git a/i18n/zh-cn.toml b/i18n/zh-cn.toml index 629baa56..9e956304 100644 --- a/i18n/zh-cn.toml +++ b/i18n/zh-cn.toml @@ -151,6 +151,9 @@ other = "特小号" [funding_alipay] other = "支付宝" +[funding_buymeacoffee] +other = "Buy Me a Coffee" + [funding_ko_fi] other = "Ko-fi" diff --git a/i18n/zh-hans.toml b/i18n/zh-hans.toml index 629baa56..9e956304 100644 --- a/i18n/zh-hans.toml +++ b/i18n/zh-hans.toml @@ -151,6 +151,9 @@ other = "特小号" [funding_alipay] other = "支付宝" +[funding_buymeacoffee] +other = "Buy Me a Coffee" + [funding_ko_fi] other = "Ko-fi" diff --git a/i18n/zh-hant.toml b/i18n/zh-hant.toml index fb2b8a05..0cfe892e 100644 --- a/i18n/zh-hant.toml +++ b/i18n/zh-hant.toml @@ -151,6 +151,9 @@ other = "特小號" [funding_alipay] other = "支付寶" +[funding_buymeacoffee] +other = "Buy Me a Coffee" + [funding_ko_fi] other = "Ko-fi" diff --git a/i18n/zh-hk.toml b/i18n/zh-hk.toml index e7c3daea..6f6a68a8 100644 --- a/i18n/zh-hk.toml +++ b/i18n/zh-hk.toml @@ -151,6 +151,9 @@ other = "特小號" [funding_alipay] other = "支付寶" +[funding_buymeacoffee] +other = "Buy Me a Coffee" + [funding_ko_fi] other = "Ko-fi" diff --git a/i18n/zh-tw.toml b/i18n/zh-tw.toml index fb2b8a05..0cfe892e 100644 --- a/i18n/zh-tw.toml +++ b/i18n/zh-tw.toml @@ -151,6 +151,9 @@ other = "特小號" [funding_alipay] other = "支付寶" +[funding_buymeacoffee] +other = "Buy Me a Coffee" + [funding_ko_fi] other = "Ko-fi" diff --git a/layouts/partials/post/panel/funding.html b/layouts/partials/post/panel/funding.html index 904c61f2..a20e4acc 100644 --- a/layouts/partials/post/panel/funding.html +++ b/layouts/partials/post/panel/funding.html @@ -8,7 +8,8 @@ "paypal" "paypal" "patreon" "patreon" }} -{{- $urls := dict +{{- $urls := dict + "buymeacoffee" "https://www.buymeacoffee.com/%s" "ko_fi" "https://ko-fi.com/%s" "patreon" "https://www.patreon.com/%s" "paypal" "https://paypal.me/%s"