本文最后更新于:2024年1月14日 晚上

赞赏啊,是一个博客里的摆设功能。
本文介绍如何在Hexo Next主题中加入赞赏。

获取支付码

在微信、支付宝中拿到赞赏码、付款码图片,放入themes/next/source/images文件夹中。

比如我的是 wechatpay.png和alipay.jpg

修改主题配置文件

修改主题配置文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
# Reward (Donate)
# Front-matter variable (unsupport animation).
reward_settings:
# If true, reward will be displayed in every article by default.
enable: true
animation: false # 开启后鼠标放到图片上文字不停抖动,不建议开启
comment: 您的支持是我前进的最大动力!

reward:
wechatpay: /images/wechatpay.png
alipay: /images/alipay.jpg
#paypal: /images/paypal.png
#bitcoin: /images/bitcoin.png

效果

生成hexo 后,在每篇文章下方都出现了donate按钮,点击会展开:

翻译

如果你不喜欢Donate、 Wechat Pay 和 Alipay这样的字眼,可以在 themes/next/languages/zh-Hans.yml 中添加字段进行翻译:

1
2
3
4
reward:
donate:
wechatpay:
alipay: 支付宝

翻译后就是现在的效果:

↓↓↓


文章链接:
https://www.zywvvd.com/notes/hexo/theme/next/15-add-reward/next-add-reward/


“觉得不错的话,给点打赏吧 ୧(๑•̀⌄•́๑)૭”

微信二维码

微信支付

支付宝二维码

支付宝支付

Next -15- 增加赞赏功能
https://www.zywvvd.com/notes/hexo/theme/next/15-add-reward/next-add-reward/
作者
Yiwei Zhang
发布于
2020年3月21日
许可协议