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

Add reward 增加文章打赏功能 #186

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

zhwhong
Copy link

@zhwhong zhwhong commented Mar 22, 2017

  • 修改主题配置文件_config.yml中的donate使能控制是否打赏
# 文章末尾是否显示打赏按钮
donate:
  #on: true
  reward_comment: 哎呦,不行了,要睡觉了,赏我 e(=2.72) 元咖啡钱吧,您的支持将鼓励我继续创作!
  wechatpay: /img/wechat-reward-qr.png
  alipay: /img/alipay-reward-qr.png
  • 打赏通过donate->on使能的true和false控制;
  • 打赏配文自定义;
  • 支持微信和支付宝二维码打赏,给出二维码地址即可;
  • 打赏功能代码单独分模块layout/_partial/donate.ejssource/css/_partial/donate.styl控制,不影响原始代码,具体显示样式可以方便修改css和ejs文件,根据自己喜好可以设置按钮为打赏图标;
  • PC,移动端显示均良好。

打赏效果图示例:

  • 默认不显示二维码:

  • 点击打赏按钮后显示二维码:

效果可以看我的博客:https://zhwhong.cn

@@ -2,6 +2,7 @@
@import "_variables"
@import "_util/mixin"
@import "_util/grid"
@import "_partial/sidebar"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该是_partial/donate

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

恩,对对,我自己本地是donate,估计是复制到hexo-theme-yelee仓库里面提pull request时打错了,谢谢指正

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更正,可以了

Copy link
Author

@zhwhong zhwhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更正,可以了

@@ -2,6 +2,7 @@
@import "_variables"
@import "_util/mixin"
@import "_util/grid"
@import "_partial/sidebar"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更正,可以了

@tyrionyu
Copy link

tyrionyu commented Nov 29, 2017

@zhwhong 我按你的方法改了,另外一个主题,怎么就不行呢?

@zhwhong
Copy link
Author

zhwhong commented Nov 29, 2017

@tyrionyu 不同主题其实现方式可能有所不同,你要看具体的layout里的ejs是怎么实现的,然后对应的修改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants