在个人服务器利用hexo搭建博客

2次阅读

共计 678 个字符,预计需要花费 2 分钟才能阅读完成。

准备
1、一台主机 我的是阿里云(CentOS 系统)2、node.js 可以参照我这篇文章搭建环境 https://segmentfault.com/a/11…3、git 安装后查看版本正常输出代表安装成功
$ sudo yum install git-core
$ git –version
git version 1.8.3.1
Hexo 安装
$ npm install -g hexo-cli
$ hexo version
hexo-cli: 1.1.0
os: Linux 3.10.0-693.2.2.el7.x86_64 linux x64
http_parser: 2.7.0
node: 9.3.0
v8: 6.2.414.46-node.15
uv: 1.18.0
zlib: 1.2.11
ares: 1.13.0
modules: 59
nghttp2: 1.25.0
openssl: 1.0.2n
icu: 60.1
unicode: 10.0
cldr: 32.0
tz: 2017c
新建博客
1、建立文件夹
$ hexo init blog
2、安装
$ cd blog
$ npm install
3、生成静态页面
$ hexo g
4、启动 hexo 博客
$ hexo s
更换 hexo 主题
1、下载 next 主题
$ cd /home/blog/theme
$ git clone https://github.com/iissnan/hexo-theme-next themes/next
2、配置 hexo 主题(_config.yml)主要是配置 theme 选项,其他配置可以自行参考 hexo 官网
theme: hexo-theme-next
更换主题后重新生成静态文件然后启动
$ hexo g
$ hexo s

正文完
 0