github博客之更新完善

wsl安装nodejs8.x

1
2
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install nodejs

wsl安装hexo-cli

1
2
3
4
5
6
7
cd /mnt/f/
sudo npm install -g hexo-cli
hexo --version #1.0.4
hexo init hexo && cd hexo
hexo new hello #创建新文章
hexo g #生产静态页面
hexo s #启动本地测试服务

hexo安装next主题

1
2
3
4
git clone https://github.com/iissnan/hexo-theme-next themes/next
#复制next主题到hexo\themes目录下,修改配置文件_config.yml中的theme为next
hexo clean
hexo g && hexo s

hexo引入gitment评论

参考:Gitment:使用 GitHub Issues 搭建评论系统

简介:Gitment 是作者实现的一款基于 GitHub Issues 的评论系统。

hexo\themes\next\_config.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  #菜单
tags: /tags/ || tags
updated: 2018-01-28 21:41:27
categories: /categories/ || th
#样式
scheme: Pisces
#评论
gitment:
enable: true
mint: true # RECOMMEND, A mint on Gitment, to support count, language and proxy_gateway
count: true # Show comments count in post meta area
lazy: false # Comments lazy loading with a button
cleanly: false # Hide 'Powered by ...' on footer, and more
language: # Force language, or auto switch by theme
github_user: xuanfong1 # MUST HAVE, Your Github ID
github_repo: hexo # MUST HAVE, The repo you use to store Gitment comments
client_id: ff47a05197bc142b8dc0 # MUST HAVE, Github client id for the Gitment
client_secret: b52d05ee5566230edfcf653efab9fd9fce6756c8 # EITHER this or proxy_gateway, Github access secret token for the Gitment
proxy_gateway: # Address of api proxy, See: https://github.com/aimingoo/intersect
redirect_protocol: # Protocol of redirect_uri with force_redirect_protocol when mint enabled

Hexo配置next主题配置

常见问题

leancould开启评论需要在控制台先创建Counter Class