Hexo
Lukeclever ComputerSavvyMedic
It has been 0 days since the last update of this post. Some contents may be outdated. Please pay attention to screening.

本文将介绍Hexo安装、主题安装、插件安装、Hexo升级有关操作。

Hexo 更新

准备

每次更新或者定期都要进行备份。本人主要备份网站根目录的散装文件和source文件夹,如果对模板有更改,首次备份也可以备份一下scaffolds文件夹。

清理 npm 缓存

1
npm cache clean -f --force

安装升级工具(-g 全局)

1
2
npm install -g npm-check
npm install -g npm-upgrade

更新全局包

检查全局包是否可以更新

1
npm-check -g

更新全局包

1
npm update -g

更新 Hexo

1
npm install --global hexo

更新插件

定位至博客根目录

在博客根目录右键选择Git Bash Here

检查可更新的包

1
npm-check

更新 package.json 与插件

1
2
npm-upgrade
npm update --save --force

主题更新

1
npm install hexo-theme-keep@latest

或者通过git pull更新到分支的最新版本

从头合成

安装Hexo

1
2
3
4
5
npm install hexo-cli -g
hexo init blog
cd blog
npm install
hexo server

至此,打开 http://localhost:4000 即可访问创建好的初始博客站点。

安装主题Keep

1
2
cd blog
npm install hexo-theme-keep
 Comments
Comment plugin failed to load
Loading comment plugin