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

准备
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

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理