博客模板 next 主题版本 打赏小工具

    选择打赏方式

温馨提示:
本文最后更新于2018年02月22日,已超过6年2个月(约2255天)没有更新,若内容或图片失效,请留言反馈。

Playing-reward 

一个打赏的小功能hexo Next主题版 

打赏功能演示地址https://sponsor.ihoey.com/ 

新建文件 将 reward.swig 文件放入 /themes/next/layout/_macro/ 文件夹内 

修改模板  修改同目录下的 post.swig 文件

<!-- 找到对应的部分 -->
{% if theme.wechat_subscriber.enabled and not is_index %}
<div>
{% include 'wechat-subscriber.swig' %}
</div>
{% endif %}
<!-- 新增以下片段 -->
<!-- 新增部分 -->
{% if theme.reward.enable and not is_index %}
<div>
{% include 'reward.swig' %}
</div>
{% endif %}
<!-- 新增部分 -->
 
{% if theme.post_copyright.enable and not is_index %}
<div>
{% include 'post-copyright.swig' with { post: post } %}
</div>
{% endif %}

修改配置文件

# Reward
reward:
enable: true
reward_comment: 满分是10分的话,这篇文章你给几分,您的支持将鼓励我继续创作!
TencentQR: /qcode/tencent_qcode.png
AliPayQR: /qcode/alipay_qcode.png
WeChatQR: /qcode/wechat_qcode.png
PayPalLink: https://www.paypal.me/ihoey
Github: https://github.com/houyi1121/Playing-reward

引入 css 文件

将 reward.css 文件放入 themes/next/source/css/_custom 在 themes/next/source/css/_custom/custom.styl 文件中加入

@import "reward.css";

引入 js 文件

将 reward.js 文件放入 themes/next/source/js/src 在 themes/next/layout/_custom/head.swig 文件中加入

<script src="/js/src/reward.js"></script>

引入 images 文件

将 images 文件夹中的图片放入 themes/next/source/images 文件夹中 

好了~ 教程结束

版权声明:若无特殊注明,本文为《寒星皓月》原创,转载请保留文章出处。
本文链接:https://www.wanghanyue.com/post-18.html
作品采用:知识共享署名 4.0 (CC BY-NC-SA 4.0) 国际许可协议 进行许可。
正文到此结束

相关推荐

发表吐槽

你肿么看?

你还可以输入 250 / 250 个字

呵呵 哈哈 羡慕 惊恐 超赞 嗯哼 滑稽 不高兴 大哭 疑问 你懂得 打脸 黑线 委屈 小乖 酷 笑眼 汗 what 鄙视 喷 阴险 怒 吃瓜

评论信息框
可使用QQ号实时获取昵称+头像

私密评论

吃奶的力气提交吐槽中...


既然没有吐槽,那就赶紧抢沙发吧!