diff --git a/config/_default/params.toml b/config/_default/params.toml index c1bc43a6..7f3abf80 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -160,7 +160,7 @@ forgejoDefaultServer = "https://v11.next.forgejo.org" # globalWidget = true # globalWidgetMessage = "Hello" # globalWidgetColor = "#FFDD00" - # globalWidgetPosition = "Right" + # globalWidgetPosition = "right" [verification] # google = "" diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index f42a8500..80196217 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -159,7 +159,7 @@ fingerprintAlgorithm = "sha512" # Valid values are "sha512" (default), "sha384", globalWidget = true globalWidgetMessage = "" globalWidgetColor = "#FFDD00" - globalWidgetPosition = "Right" + globalWidgetPosition = "right" [verification] # google = "" diff --git a/exampleSite/content/docs/configuration/index.it.md b/exampleSite/content/docs/configuration/index.it.md index c173c036..270ebfd5 100644 --- a/exampleSite/content/docs/configuration/index.it.md +++ b/exampleSite/content/docs/configuration/index.it.md @@ -353,8 +353,8 @@ Many of the article defaults here can be overridden on a per article basis by sp | `buymeacoffee.identifier` | _Not set_ | The identifier to the target buymeacoffee account. | | `buymeacoffee.globalWidget` | _Not set_ | Activate the global buymeacoffee widget. | | `buymeacoffee.globalWidgetMessage` | _Not set_ | Message what will be displayed the first time a new user lands on the site. | -| `buymeacoffee.globalWidgetColor` | _Not set_ | Widget color in hex format. | -| `buymeacoffee.globalWidgetPosition` | _Not set_ | Position of the widget, i.e. "Left" or "Right" | +| `buymeacoffee.globalWidgetColor` | `#FFDD00` | Widget color in hex format. | +| `buymeacoffee.globalWidgetPosition` | _Not set_ | Position of the widget, i.e. "left" or "right" | ### Verifications diff --git a/exampleSite/content/docs/configuration/index.ja.md b/exampleSite/content/docs/configuration/index.ja.md index bd3400f9..9a8adc9f 100644 --- a/exampleSite/content/docs/configuration/index.ja.md +++ b/exampleSite/content/docs/configuration/index.ja.md @@ -353,8 +353,8 @@ Blowfish は、テーマの機能を制御する多数の設定パラメータ | `buymeacoffee.identifier` | _未設定_ | ターゲットの buymeacoffee アカウントの識別子。 | | `buymeacoffee.globalWidget` | _未設定_ | グローバル buymeacoffee ウィジェットを有効にします。 | | `buymeacoffee.globalWidgetMessage` | _未設定_ | 新しいユーザーが初めてサイトにアクセスしたときに表示されるメッセージ。 | -| `buymeacoffee.globalWidgetColor` | _未設定_ | ウィジェットの色(16進数形式)。 | -| `buymeacoffee.globalWidgetPosition` | _未設定_ | ウィジェットの位置。例えば "Left" または "Right" | +| `buymeacoffee.globalWidgetColor` | `#FFDD00` | ウィジェットの色(16進数形式)。 | +| `buymeacoffee.globalWidgetPosition` | _未設定_ | ウィジェットの位置。例えば "left" または "right" | ### verification diff --git a/exampleSite/content/docs/configuration/index.md b/exampleSite/content/docs/configuration/index.md index 736161cc..092526a0 100644 --- a/exampleSite/content/docs/configuration/index.md +++ b/exampleSite/content/docs/configuration/index.md @@ -360,8 +360,8 @@ Many of the article defaults here can be overridden on a per article basis by sp | `buymeacoffee.identifier` | _Not set_ | The identifier to the target buymeacoffee account. | | `buymeacoffee.globalWidget` | _Not set_ | Activate the global buymeacoffee widget. | | `buymeacoffee.globalWidgetMessage` | _Not set_ | Message what will be displayed the first time a new user lands on the site. | -| `buymeacoffee.globalWidgetColor` | _Not set_ | Widget color in hex format. | -| `buymeacoffee.globalWidgetPosition` | _Not set_ | Position of the widget, i.e. "Left" or "Right" | +| `buymeacoffee.globalWidgetColor` | `#FFDD00` | Widget color in hex format. | +| `buymeacoffee.globalWidgetPosition` | _Not set_ | Position of the widget, i.e. "left" or "right" | ### Verifications diff --git a/exampleSite/content/docs/configuration/index.zh-cn.md b/exampleSite/content/docs/configuration/index.zh-cn.md index f4e50ddb..74425b8b 100644 --- a/exampleSite/content/docs/configuration/index.zh-cn.md +++ b/exampleSite/content/docs/configuration/index.zh-cn.md @@ -352,13 +352,13 @@ Blowfish 提供了大量控制主题功能的配置参数,下面的表格中 ### BuyMeACoffee(赞助平台) -| 名称 | 默认值 | 描述 | -| ----------------------------------- | ------ | ---------------------------------- | -| `buymeacoffee.identifier` | 无 | buymeacoffee 账号的用户名。 | -| `buymeacoffee.globalWidget` | 无 | 激活位于全局的 buymeacoffee 组件。 | -| `buymeacoffee.globalWidgetMessage` | 无 | 新用户首次访问网站时显示的消息。 | -| `buymeacoffee.globalWidgetColor` | 无 | 组件颜色,使用 HEX 格式。 | -| `buymeacoffee.globalWidgetPosition` | 无 | 组件位置,例如 "Left" 或 "Right"。 | +| 名称 | 默认值 | 描述 | +| ----------------------------------- | --------- | ---------------------------------- | +| `buymeacoffee.identifier` | 无 | buymeacoffee 账号的用户名。 | +| `buymeacoffee.globalWidget` | 无 | 激活位于全局的 buymeacoffee 组件。 | +| `buymeacoffee.globalWidgetMessage` | 无 | 新用户首次访问网站时显示的消息。 | +| `buymeacoffee.globalWidgetColor` | `#FFDD00` | 组件颜色,使用 HEX 格式。 | +| `buymeacoffee.globalWidgetPosition` | 无 | 组件位置,例如 "left" 或 "right"。 | ### 验证 diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 126af5c4..eeea21b4 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -48,9 +48,9 @@ src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js" data-id="{{ site.Params.buymeacoffee.identifier }}" data-description="Support me on Buy me a coffee!" - data-message="{{ site.Params.buymeacoffee.globalWidgetMessage | default "" }}" - data-color="{{ site.Params.buymeacoffee.globalWidgetColor | default "#FFDD00" }}" - data-position="{{ site.Params.buymeacoffee.globalWidgetPosition | default "Left" }}" + {{ with site.Params.buymeacoffee.globalWidgetMessage }}data-message="{{ . }}"{{ end }} + {{ with site.Params.buymeacoffee.globalWidgetColor | default `#FFDD00` }}data-color="{{ . }}"{{ end }} + {{ with site.Params.buymeacoffee.globalWidgetPosition }}data-position="{{ . }}"{{ end }} data-x_margin="18" data-y_margin="18"> {{ end }} diff --git a/layouts/partials/scroll-to-top.html b/layouts/partials/scroll-to-top.html index 27bbd397..e67ff134 100644 --- a/layouts/partials/scroll-to-top.html +++ b/layouts/partials/scroll-to-top.html @@ -1,4 +1,4 @@ -{{ $coffeeIsRight := and site.Params.buymeacoffee.globalWidget (eq site.Params.buymeacoffee.globalWidgetPosition "Right") }} +{{ $coffeeIsRight := and site.Params.buymeacoffee.globalWidget (eq (lower site.Params.buymeacoffee.globalWidgetPosition) "right") }} {{ $toTopYOffset := cond $coffeeIsRight "bottom-24" "bottom-6" }}