NexT主题的设置 - hexo新版主题next7.x设置
· 5 min read
内容提要
-
开启赞赏打赏码
-
设置阅读时长和本文字数
-
添加背景动画效果
-
阅读全文设置
-
阅读全文 去掉自动定位 more
-
修改文章及主题样式
-
代码段调整上下行距及样式
-
代码块背景色缺失问题
开启赞赏打赏码
1.获取支付宝和微信打赏码
- 支付宝打赏码
- 微信打赏码
- 打开手机微信
- 选择我的–支付
- 选择收付款–赞赏码
- 生成
2.把 生成的二维码下载放到 next 主题
- 放到 themes\next\source\images 文件夹中
3.配置主题_config.yml
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.png
#paypal: /images/paypal.png
#bitcoin: /images/bitcoin.png
4.修改按钮样式
//路径 next/source/css/_common/components/post/post-reward.styl
//简单的改了一下按钮样式
button {
background: transparent;
border: 1px solid #fc6423;
border-radius: 5px;
color: #fc6423;
cursor: pointer;
line-height: 2;
outline: none;
padding: 0 15px;
vertical-align: text-top;
&:hover {
background: #fc6423;
border: 1px solid transparent;
color: #fff;
}
}
5.展示效果

设置阅读时长和本文字数
1.配置主题_config.yml
symbols_count_time:
separated_meta: true
item_text_post: true
item_text_total: false
awl: 2 #平均字长
wpm: 200 #每分钟字数
详细配置介绍 https://github.com/theme-next/hexo-symbols-count-time
2.对应文字修改
#路径 next\languages\zh-CN.yml
symbols_count_time:
count: 本文字数
count_total: 站点总字数
time: 阅读时长
time_total: 站点阅读时长
time_minutes: 分钟
3.展示效果

设置阅读次数和评论
建议添加 gitalk 评论系统
参考文章:https://www.jianshu.com/p/02fc71f3633f
展示效果

