win10搭建hexo博客
1.安装了git,安装nodejs
2.安装cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
通过输入 “npm -v” 来测试是否成功安装。命令如下,出现版本提示表示安装成功:
$ npm -v
npm下载插件要翻墙,使用淘宝镜像的命令:
npm install -g cnpm --registry=https://registry.npm.taobao.org
3.安装hexo框架
命令需要在提示命令符(管理员)打开
cnpm install -g hexo-cli
4.初始化hexo
D:\Blog>hexo init
5.开启
D:\Blog>hexo s
6.创建博客文章
D:\Blog>hexo n "win10下搭建hexo博客"
D:\Blog>hexo clean
INFO Deleted database.
D:\Blog>hexo g
7.安装git插件
D:\Blog>cnpm install --save hexo-deployer-git
8.配置——config.yml文件
deploy:
type: 'git'
repo: https://github.com/LouXueLang/LouXueLang.github.io.git
branch: master
记住这里是仓库地址
branch不写的话是默认master
9.部署远端
hexo d
如果报错,这是git没有设置用户和邮箱
D:\Blog>git config user.name
D:\Blog>git config user.email
D:\Blog>git config --global user.name "username"
D:\Blog>git config --global user.name "louxuelang"
D:\Blog>git config --global user.email "louxuelang@163.com"
10.访问博客网站
https://louxuelang.github.io/
克隆主题
D:\Blog>git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia