设为首页 加入收藏

TOP

使用Hexo开源博客系统,轻松搭建你的个人博客(2)- 配置篇(三)
2019-09-30 16:49:19 】 浏览:72
Tags:使用 Hexo 开源 博客 系统 轻松 搭建 个人 配置
ud_visitors' for counter compatibility. Article reading statistic https://valine.js.org/visitor.html comment_count: true # if false, comment count will only be displayed in post page, not in home page

valine是第三方插件,需要到https://leancloud.cn注册账号,获取到appid和appkey后放到这里即可。avatar是设置默认头像,可以到https://valine.js.org/avatar选择默认头像,然后在这里设置名字即可。

开启百度分享

# Baidu Share
# Available values: button | slide
# Warning: Baidu Share does not support https.
baidushare:
  type: button  # 设置分享按钮的风格,有button何slide形式

开启needmoreshare分享

needmoreshare2:
  enable: false
  postbottom:
    enable: false
    options:
      iconStyle: box
      boxForm: horizontal
      position: bottomCenter
      networks: Weibo,Wechat,Douban,QQZone,Twitter,Facebook
  float:
    enable: false
    options:
      iconStyle: box
      boxForm: horizontal
      position: middleRight
      networks: Weibo,Wechat,Douban,QQZone,Twitter,Facebook

needmoreshare2依赖theme-next-needmoreshare2模块,要开启的朋友可以到https://github.com/theme-next/theme-next-needmoreshare2找到方法。

设置文章阅读量

leancloud_visitors:
  enable: true
  app_id: 
  app_key: 
  # Dependencies: https://github.com/theme-next/hexo-leancloud-counter-security
  # If you don't care about security in leancloud counter and just want to use it directly
  # (without hexo-leancloud-counter-security plugin), set `security` to `false`.
  security: false
  betterPerformance: true

appid和appkey跟上面开启valine评论使用的leanCloud是一样的。如果发现文章阅读量不显示,可以到leanCloud后台的存储菜单下,创建Class,命名为Counter.

开启不蒜子统计功能

busuanzi_count:
  enable: true
  total_visitors: true #开启总访客(uv)
  total_visitors_icon: user
  total_views: true #开启总访问数(pv)
  total_views_icon: eye
  post_views: false
  post_views_icon: eye

这边的post_views和上面的leanCloud_visitors冲突,两者都是显示文章阅读量,只开启一个就可以了。

开启本地博客搜索功能

local_search:
  enable: false
  # If auto, trigger search by changing input.
  # If manual, trigger search by pressing enter key or search button.
  trigger: auto
  # Show top n results per article, show all results by setting to -1
  top_n_per_article: 1
  # Unescape html strings to the readable one.
  unescape: false

该功能依赖hexo-generator-searchdb插件,使用命令npm install hexo-generator-searchdb --save来进行安装,然后在全局配置文件的末尾,加入以下代码即可。

search:
  path: search.xml
  field: post
  format: html
  limit: 10000

总结

以上就是hexo博客常用的基本配置以及基于Next主题的一些设置,更多功能大家可在使用中逐摸索,欢迎讨论交流。

需要安装的模块依赖

1.字数统计:npm install hexo-symbols-count-time --save
2.相关文章推荐:npm install hexo-related-popular-posts --save
3.本地博客搜索功能:npm install hexo-generator-searchdb --save,然后在全局配置文件末尾加入代码

第三方插件

1.valine评论系统:需要到https://leancloud.cn注册账号,获取到appid和appkey
2.文章阅读量:同样需要用到leancloud的appid和appkey

首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇vue实现简易计算器 下一篇jQuery中$()可以有两个参数

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目