Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add the funding widget #891

Merged
merged 1 commit into from
Jan 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion archetypes/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ featured = false
draft = true
comment = true
toc = true
reward = true
pinned = false
carousel = false
categories = []
tags = []
series = []
images = []
#[funding]
+++

Summary.
Expand Down
14 changes: 11 additions & 3 deletions exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,21 @@ minMatchCharLength = 3
# paginate = 10
# stallThreshold = 500

[reward]
alipay = "images/reward/alipay.png"
wechat = "images/reward/wechat.png"
# [reward]
# alipay = "images/reward/alipay.png"
# wechat = "images/reward/wechat.png"
#paypal = "images/reward/paypal.png"
#patreon = "images/reward/patreon.png"
#liberapay = "images/reward/liberapay.png"

[funding]
alipay = "https://razonyang.com/images/reward/alipay.webp"
wechat = "https://razonyang.com/images/reward/wechat.webp"
ko_fi = "razonyang"
patreon = "razonyang"
open_collective = "hbs"
paypal = "razonyang"

#[share]
#addThis = "" # AddThis pubid.

Expand Down
47 changes: 47 additions & 0 deletions exampleSite/content/docs/widgets/funding/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
+++
title = "Funding Widget"
date = 2023-01-29T19:44:19+08:00
featured = false
comment = true
toc = true
categories = [
"Widget"
]
tags = [
"Buy Me a Coffee", "Funding"
]
series = [
"Docs"
]
images = []
authors = ["RazonYang"]
[menu.footer]
parent = "features"
weight = 7
[menu.footer.params]
icon = '<i class="fas fa-fw fa-coffee"></i>'
+++

The funding widget, AKA buy me a coffee widget, gives the readers a way to support a creator.

<!--more-->

## Site Parameters

The `funding` is a key value pair that mapping from platform to their QR Code image, username or URL.

| Name | Type | Default | Description
|---|:-:|:-:|---
| `funding` | Object | - |
| `funding.alipay` | String | - | Alipay QR Code Image.
| `funding.wechat` | String | - | Wechat QR Code Image.
| `funding.paypal` | String | - | Paypal username.
| `funding.ko_fi` | String | - | Ko-fi username.
| `funding.patreon` | String | - | Patreon username.
| `funding.open_collective` | String | - | Open Collective username.

## Page Parameter

| Name | Type | Default | Description
|---|:-:|:-:|---
| `funding` | Object | - | Override the global funding settings, empty to disable.
46 changes: 46 additions & 0 deletions exampleSite/content/docs/widgets/funding/index.zh-hans.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
+++
title = "打赏小部件"
date = 2023-01-29T19:44:19+08:00
featured = false
comment = true
toc = true
categories = [
"小部件"
]
tags = [
]
series = [
"文档"
]
images = []
authors = ["RazonYang"]
[menu.footer]
parent = "features"
weight = 7
[menu.footer.params]
icon = '<i class="fas fa-fw fa-coffee"></i>'
+++

打赏小部件,又称 buy me a coffee 小部件,其通过使用捐赠或小费,为读者提供了一种支持创作者的管道。

<!--more-->

## 站点配置

`funding` 参数是从平台映射到二维码图像、用户名或 URL 的键值对。

| 名称 | 类型 | 默认值 | 描述
|---|:-:|:-:|---
| `funding` | Object | - | 打赏。
| `funding.alipay` | String | - | 支付宝收款二维码图片。
| `funding.wechat` | String | - | 微信收款/打赏二维码图片。
| `funding.paypal` | String | - | Paypal 用户名。
| `funding.ko_fi` | String | - | Ko-fi 用户名。
| `funding.patreon` | String | - | Patreon 用户名。
| `funding.open_collective` | String | - | Open Collective 用户名。

## 页面配置

| 名称 | 类型 | 默认值 | 描述
|---|:-:|:-:|---
| `funding` | Object | - | 覆盖全局的 `funding` 设置,留空则禁用。
46 changes: 46 additions & 0 deletions exampleSite/content/docs/widgets/funding/index.zh-hant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
+++
title = "打賞小部件"
date = 2023-01-29T19:44:19+08:00
featured = false
comment = true
toc = true
categories = [
"小部件"
]
tags = [
]
series = [
"文檔"
]
images = []
authors = ["RazonYang"]
[menu.footer]
parent = "features"
weight = 7
[menu.footer.params]
icon = '<i class="fas fa-fw fa-coffee"></i>'
+++

打賞小部件,又稱 buy me a coffee 小部件,其通過使用捐贈或小費,為讀者提供了一種支持創作者的筦道。

<!--more-->

## 網站參數

`reward` 參數是從平臺映射到二維碼圖像、用戶名或 URL 的鍵值對,因此支持任何支持二維碼的平臺。

| 名稱 | 類型 | 預設值 | 描述
|---|:-:|:-:|---
| `funding` | Object | - | 打賞。
| `funding.alipay` | String | - | 支付寶收款二維碼圖片。
| `funding.wechat` | String | - | 微信收款/打賞二維碼圖片。
| `funding.paypal` | String | - | Paypal 用戶名。
| `funding.ko_fi` | String | - | Ko-fi 用戶名。
| `funding.patreon` | String | - | Patreon 用戶名。
| `funding.open_collective` | String | - | Open Collective 用戶名。

## 頁面配置

| 名稱 | 類型 | 預設值 | 描述
|---|:-:|:-:|---
| `funding` | Object | - | 覆蓋全局的 `funding` 設置,留空則禁用。
12 changes: 7 additions & 5 deletions exampleSite/content/docs/widgets/reward/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ aliases = [
"/en/posts/widgets/reward"
]
authors = ["RazonYang"]
[menu.footer]
parent = "features"
weight = 7
[menu.footer.params]
icon = '<i class="fas fa-fw fa-coffee"></i>'
# [menu.footer]
# parent = "features"
# weight = 7
# [menu.footer.params]
# icon = '<i class="fas fa-fw fa-coffee"></i>'
+++

The reward widget, AKA buy me a coffee widget, gives the readers a way to support a creator through the use of donations or tips.

However, it limited to the QR code image, please take a look at the [funding widget]({{< ref "docs/widgets/funding" >}}).

<!--more-->

## Site Parameters
Expand Down
12 changes: 7 additions & 5 deletions exampleSite/content/docs/widgets/reward/index.zh-hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ aliases = [
"/zh-cn/posts/widgets/reward"
]
authors = ["RazonYang"]
[menu.footer]
parent = "features"
weight = 7
[menu.footer.params]
icon = '<i class="fas fa-fw fa-coffee"></i>'
# [menu.footer]
# parent = "features"
# weight = 7
# [menu.footer.params]
# icon = '<i class="fas fa-fw fa-coffee"></i>'
+++

打赏小部件,又称 buy me a coffee 小部件,其通过使用捐赠或小费,为读者提供了一种支持创作者的管道。

然而其只能用于二维码收款,其他请移步 [funding widget]({{< ref "docs/widgets/funding" >}})。

<!--more-->

## 站点配置
Expand Down
12 changes: 7 additions & 5 deletions exampleSite/content/docs/widgets/reward/index.zh-hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ aliases = [
"/zh-tw/posts/widgets/reward"
]
authors = ["RazonYang"]
[menu.footer]
parent = "features"
weight = 7
[menu.footer.params]
icon = '<i class="fas fa-fw fa-coffee"></i>'
# [menu.footer]
# parent = "features"
# weight = 7
# [menu.footer.params]
# icon = '<i class="fas fa-fw fa-coffee"></i>'
+++

打賞小部件,又稱buy me a coffee小部件,其通過使用捐贈或小費,為讀者提供了一種支持創作者的筦道。

然而其只能用於二維碼收款,其他請移步 [funding widget]({{< ref "docs/widgets/funding" >}})。

<!--more-->

## 網站參數
Expand Down
15 changes: 15 additions & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ other = "Extra Large"
[font_size_xs]
other = "Extra Small"

[funding_alipay]
other = "Alipay"

[funding_ko_fi]
other = "Ko-fi"

[funding_open_collective]
other = "Open Collective"

[funding_patreon]
other = "Patreon"

[funding_wechat]
other = "Wechat"

[go_back]
other = "Go back"

Expand Down
15 changes: 15 additions & 0 deletions i18n/zh-cn.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ other = "特大号"
[font_size_xs]
other = "特小号"

[funding_alipay]
other = "支付宝"

[funding_ko_fi]
other = "Ko-fi"

[funding_open_collective]
other = "Open Collective"

[funding_patreon]
other = "Patreon"

[funding_wechat]
other = "微信"

[go_back]
other = "返回"

Expand Down
15 changes: 15 additions & 0 deletions i18n/zh-hans.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ other = "特大号"
[font_size_xs]
other = "特小号"

[funding_alipay]
other = "支付宝"

[funding_ko_fi]
other = "Ko-fi"

[funding_open_collective]
other = "Open Collective"

[funding_patreon]
other = "Patreon"

[funding_wechat]
other = "微信"

[go_back]
other = "返回"

Expand Down
15 changes: 15 additions & 0 deletions i18n/zh-hant.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ other = "特大號"
[font_size_xs]
other = "特小號"

[funding_alipay]
other = "支付寶"

[funding_ko_fi]
other = "Ko-fi"

[funding_open_collective]
other = "Open Collective"

[funding_patreon]
other = "Patreon"

[funding_wechat]
other = "微信"

[go_back]
other = "返回"

Expand Down
15 changes: 15 additions & 0 deletions i18n/zh-hk.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ other = "特大號"
[font_size_xs]
other = "特小號"

[funding_alipay]
other = "支付寶"

[funding_ko_fi]
other = "Ko-fi"

[funding_open_collective]
other = "Open Collective"

[funding_patreon]
other = "Patreon"

[funding_wechat]
other = "微信"

[go_back]
other = "返回"

Expand Down
15 changes: 15 additions & 0 deletions i18n/zh-tw.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ other = "特大號"
[font_size_xs]
other = "特小號"

[funding_alipay]
other = "支付寶"

[funding_ko_fi]
other = "Ko-fi"

[funding_open_collective]
other = "Open Collective"

[funding_patreon]
other = "Patreon"

[funding_wechat]
other = "微信"

[go_back]
other = "返回"

Expand Down
1 change: 1 addition & 0 deletions layouts/partials/post/panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{{ partial "hooks/post-panel-begin" . }}
{{ partial "post/panel/translations" . }}
{{ partial "post/panel/reward" . }}
{{ partial "post/panel/funding" . }}
{{ partial "post/panel/toc" . }}
{{ partial "post/panel/copyright" . }}
{{ partial "post/panel/comments" . }}
Expand Down
Loading