git version 2.18.0.windows.1
node-v10.8.0-win-x64.zip
1 安装node.js,直接下载,配置环境变量即可(win10重启生效)
2 git安装,略,安装完直接启动Git Bash即可,git配置略(用户名,邮箱,配置github上的sshkey)
3 安装hexo(就是一个blog)流程
国外的NPM源并不稳定,即使翻墙也不一定能将Hexo下载下来,所以这里直接更改为淘宝源。
$ npm config set registry https://registry.npm.taobao.org npm info underscore
安装hexo
$ npm install -g hexo-cli
创建hexo工程
$ hexo init blog
hexo i blog //init的缩写 blog是项目名
cd blog //切换到站点根目录
新建POST
$ hexo n “Test”
进入初始化后的hexo文件夹,创建名为HelloWorld的文件,此时会在/blog/sources/_post/目录下生成Test.md文件。
hexo g //generetor的缩写 静态编译
hexo s //server的缩写 启动本地服务器
到此本地blog安装完毕
4 配置下github
新建一个response
名称必须是用户名.github.io
建立完毕后地址就是https://github.com/OnafioO/OnafioO.github.io.git
5上传代码到github
把新建的blog文件夹下的_config.yml打开
把最后一行改为
deploy: type: git repo: https://github.com/OnafioO/OnafioO.github.io.git
安装插件
npm install hexo-deployer-git --save
hexo d 发布(上传)
6 新写页面上传(一条新blog)
hexo n "newpage"
开发这个newpage
然后进入blog文件夹
hexo g 生成静态页
hexo d 发布
就完成上传
主页地址(https://onafioo.github.io/)可以在任意response/setting/GitHub Pages 处找到
https://blog.csdn.net/Hoshea_chx/article/details/78826689
https://www.jianshu.com/p/3217ecf4a789
https://www.cnblogs.com/EX32/p/4479712.html