更换电脑更新Hexo

由于自己更多的时间是在办公室,希望能在办公室的电脑上也能更新,于是在办公室的破电脑上也部署了一下环境,方便更新Hexo。

一、备份内容

主要备份<folder>目录下的source文件夹、_config.yml文件,以themes文件夹。

二、安装部署Hexo

(一)参考Hexo搭建教程中安装必备的程序

  1. Git
  2. Node.js

同时按照Hexo搭建教程配置SSH key。

(二)安装Hexo

安装好必要软件后,使用npm安装Hexo

1
$ npm install -g hexo-cli #使用npm安装 Hexo。

初始化Hexo

1
$ npm install

(三)安装插件

主要有:首页文章数量,存档,分类的插件;部署器插件;rss site-map之类插件。

1
2
3
4
5
6
7
8
9
10
11
12
13
npm install hexo-generator-index --save
npm install hexo-generator-archive --save
npm install hexo-generator-category --save
npm install hexo-generator-tag --save
npm install hexo-server --save
npm install hexo-deployer-git --save
npm install hexo-deployer-heroku --save
npm install hexo-deployer-rsync --save
npm install hexo-deployer-openshift --save
npm install hexo-renderer-marked --save
npm install hexo-renderer-stylus --save
npm install hexo-generator-feed --save
npm install hexo-generator-sitemap --save

三、重新部署Hexo

输入

1
hexo d -g

搞定收工。
注意:详细安装、部署请参考Hexo搭建教程

分享到 评论