Hexo的简单安装

Hexo的简单安装

十二月 26, 2018

1. 在centos环境下安装

1、安装nodejs

1
yum install nodejs

2、安装hexo

1
npm install -g hexo-cli

3、初始化项目

1
hexo init doc

4、npm安装,需要在项目目录下执行命令

1
npm install

5、安装Next主题

1
2
3
4
git clone https://github.com/theme-next/hexo-theme-next themes/next

# 修改_config.yml配置文件
# theme :next

6、修改_config.yml配置文件,添加github仓库配置

1
2
3
4
deploy:
type: git
repo: https://github.com/xxx/xxx.git
branch: master

7、hexo常用命令

1
2
3
4
5
6
7
8
# 生成项目
hexo g

# 发布项目,推送到git远程仓库
hexo d

# 开启本地服务,通过localhost:4000访问
hexo s