51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

Hexo增加Valine评论系统

前言 {#前言}

Hexo博客支持的评论系统其实有很多,本站选用了Valine,选择原因:轻量级、访问速度快、配置过程简单,以上三个原因足够我选择它了。

Valine评论系统的配置其实很简单,在这里就简单介绍一下。

操作流程 {#操作流程}

  1. 注册帐号
    在LeanCloud官网(https://www.leancloud.cn/)免费注册一个帐号,注册后需要实名认证即可使用不同的服务了。

  2. 创建应用

  • 点击左上角LeanCloud后选择创建应用
  • 填写应用名称
  • 默认选择开发版
  • 自行选择是否填写应用描述
  • 最后点击创建按钮
  1. 修改配置
    打开_config.butterfly.yml配置,找到valine配置,修改appidappkey

    |------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 2 3 4 5 6 7 8 9 10 | # valine # https://valine.js.org valine: appId: 请在这里填写你的appId # leancloud application app id appKey: 请在这里填写你的appKey # leancloud application app key avatar: monsterid # gravatar style https://valine.js.org/#/avatar serverURLs: # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in) bg: # valine background visitor: false option: |

    同时修改选择的评论系统为Valine即可

    |------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 2 3 4 5 6 7 8 9 10 | comments: # Up to two comments system, the first will be shown as default # Choose: Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/Artalk use: Valine # 请在这里选择你的评论系统类型:Valine,Disqus text: true # Display the comment name next to the button # lazyload: The comment system will be load when comment element enters the browser's viewport. # If you set it to true, the comment count will be invalid lazyload: false count: false # Display comment count in post's top_img card_post_count: false # Display comment count in Home Page |

  2. 重新生成博客系统即可看到效果

    |---------------|-------------------------------| | 1 2 3 | hexo cl hexo g hexo s |


赞(3)
未经允许不得转载:工具盒子 » Hexo增加Valine评论系统