前面我写了一篇《利用Github pages建站-超简单小白专属 》
随着hexo版本的升级,我在这篇博文里对内容进行更新
GitHub准备
- 注册github账号,并新建一个
用户名+github.io的repository
下载安装nodejs
安装hexo
npm install hexo-cli -g #安装
hexo init blog #初始化项目
cd blog
npm install #安装依赖
hexo server #本地查看效果,访问地址为http://localhost:4000
更换主题
- 安装配置
freemind主题 - 在blog目录下
git clone https://github.com/wzpan/hexo-theme-freemind.git themes/freemindnpm install hexo-tag-bootstrap --save-
添加blog目录下添加的
source目录下分别添加categories,tags,about,并分别新建index.html内容分别如下:
title: Categories
layout: categories
---
title: Tags
layout: tags
---
title: About
layout: page
---
Something about me. ;-)
- 配置freemind
在blog\themes\freemind目录下有个_config.yml请按照需要修改
配置hexo
- 在
blog根目录下也有个_config.yml,按照自己需求修改 - 其中主题修改
theme: freemind
发布到github
- 先安装git部署插件
npm install hexo-deployer-git --save
- 修改根目录下
_config.yml
deploy:
type: git
repository: https://github.com/wiselyman/wiselyman.github.io.git
branch: master
- 发布
hexo clean
hexo generate
hexo deploy #输入帐号密码
效果: