您的位置:首页 > 其它

hexo的next主题常用设置

2017-08-07 00:28 211 查看
欢迎访问我的个人博客网站:http://www.yanmin99.com/

Hexo的Next主题增加畅言评论

评论插件选择

多说评论已经确定在2017年6月1日正式关停服务,网易云跟贴确定在2017年8月1日停服。所以推荐大家使用搜狐的畅言评论

一、畅言评论

注册畅言评论



添加站点



获取APP ID、APP KEY



二、上线畅言评论

打开
themes/next/_config.yml
文件

设置
enable:true
,并且把后后台APP ID、APP KEY设置给appid和appkey



hexo server
启动以后,访问如果出现以下错误

Unhandled rejection Error: ENOENT: no such file or directory, open '/disk2/blog/themes/next/layout/_third-party/comments/changyan.swig'
at Object.fs.openSync (fs.js:651:18)
at Object.fs.readFileSync (fs.js:553:33)
at Object.ret.load (/disk2/blog/node_modules/swig/lib/loaders/filesystem.js:55:15)
at exports.Swig.compileFile (/disk2/blog/node_modules/swig/lib/swig.js:695:31)
at Object.eval [as tpl] (eval at precompile (/disk2/blog/node_modules/swig/lib/swig.js:498:13), <anonymous>:15:18)
at compiled (/disk2/blog/node_modules/swig/lib/swig.js:619:18)
at Object.eval [as tpl] (eval at precompile (/disk2/blog/node_modules/swig/lib/swig.js:498:13), <anonymous>:853:127)
at compiled (/disk2/blog/node_modules/swig/lib/swig.js:619:18)
at Theme._View.View._compiled (/disk2/blog/node_modules/hexo/lib/theme/view.js:127:30)
at Theme._View.View.View.render (/disk2/blog/node_modules/hexo/lib/theme/view.js:29:15)
at /disk2/blog/node_modules/hexo/lib/hexo/index.js:390:25
at tryCatcher (/disk2/blog/node_modules/bluebird/js/release/util.js:16:23)
at /disk2/blog/node_modules/bluebird/js/release/method.js:15:34
at RouteStream._read (/disk2/blog/node_modules/hexo/lib/hexo/router.js:134:3)
at RouteStream.Readable.read (_stream_readable.js:431:10)
at resume_ (_stream_readable.js:811:12)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)


把changyan.swig地址拷贝以下:cp layout/_scripts/third-party/comments/changyan.swig layout/_third-party/comments/欢迎访问我的个人博客网站:http://www.yanmin99.com/

一、加入搜索功能

加入搜索功能步骤

1、安装searchdb

//安装hexo-generator-searchdb
npm install hexo-generator-searchdb --save


2、添加search字段,在站点配置文件
myBlog/_config.yml
添加search字段

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


3、编辑主题配置文件
myBlog/themes/next/_config.yml
,启用本地搜索功能:

# Local search

local_search:
enable: true


4、运行效果图

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: