title: Github+hexo搭建个人博客
tags: created by luffy
一、hexo搭建本地博客
1.安装Node.js
2.npm install -g cnpm --registry=https://registry.npm.taobao.org
3.cnpm install -g hexo-cli
4.新建一个文件夹,来存放博客内容
5.进入文件夹,cmd命令:hexo init
6.启动博客:hexo s
7.新建文章:hexo n "blogName"(生成的是md文件)
8.生成博客文章:hexo g
二、博客部署到Github
1.Github新建仓库
2.仓库命名必须为:用户名.github.io
3.安装hexo相关git插件:cnpm install --save hexo-deployer-git
4.blog目录下设置_config.yml文件:
Deployment下
type: git
repo: 仓库地址(后缀为.git的url)
branch: master
5.hexo d
三、自定义博客主题
GitHub:github.com/litten/hexo-theme-yilia
更换主题:
1.git clone
https://github.com/litten/hexo-theme-yilia.git themes/yilia
https://github.com/luuman/hexo-theme-spfk.git themes/spfk
2.修改_config,yml: theme: yilia
3.重启hexo:hexo clean->hexo g-> hexo s
4.推到远端:hexo d