使用Hexo搭建博客
使用Hexo搭建博客
1. 安装Hexo
前提:
- 安装了nodejs
- 安装了git
安装hexo:npm install -g hexo-cli
2. 创建博客
创建博客: hexo init 博客名称 eg:hexo init nyBlog
进入项目: cd 博客目录 eg:cd nyBlog
安装依赖:npm install
启动项目:hexo server
3. 修改主题
选取自己喜欢的主题:https://hexo.io/themes/,以hexo-theme-butterfly主题为例,进入git主页
安装主题:git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
安装依赖:npm install hexo-renderer-jade hexo-renderer-stylus --save
应用主题:在项目根目录下找到_config.yml文件,进行如下修改
注意
每种主题的使用方式不同,请参考主题对应的git教程进行添加