GitHub+Hexo建博客

来源:互联网 发布:如何取淘宝店名 编辑:程序博客网 时间:2024/05/16 15:33

首先做好准备工作

1.申请GitHub账号,新建一个仓库(以自己喜欢的名字命名,以后就是你的博客网址名啦~~)
2.安装node,后面主要作包管理工具用(最好全局安装,问我为什么,方便呀~)
3.下载安装git
以上三点可百度查询具体操作


GithubPage的相关操作

1.git clone https://github.com/username/username.github.io
2.cd username.github.io
3.git add --all
4.git commit -m "Initial commit"
5.git push -u origin master
以上5步就能够访问你的专属地址了,无需VPN哦~~参考地址


Hexo的相关配置

1.利用 npm 命令即可安装。在任意位置点击鼠标右键,选择Git Bash
2.输入命令:npm install -g hexo
3.创建文件夹(我的是在D盘根目录下创建的Hexo)
4.在Hexo文件下,右键运行Git Bash,输入命令:hexo init
5.在_config.yml进行基础配置


更换博客主题

1.Install 安装
$ git clone https://github.com/monniya/hexo-theme-new-vno.git themes/new-vno
2.Enable 主题启用设置
设置全局的_config.yml theme: new-vno
3.Configuration 主题设置
设置主题的配置文件:_config.yml


部署到Github上

1.申请Github账号(注意别忘了进行账号邮箱验证)
2.new repository
3.在_config.yml进行配置
4.安装hexo-deployer-git自动部署发布工具
npm instal lhexo-deployer-git --save
5.发布到Github
hexo clean && hexo g && hexo d
6.测试访问
在浏览器输入:https://Cabalash.github.io/