查找资料的时候发现了next这个博客主题,next!非常的漂亮,顺手查看了hexo的相关部署。
Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用 Markdown(或其他渲染引擎)解析文章,在几秒内,即可利用靓丽的主题生成静态网页。
官网 https://hexo.io/zh-cn/docs/index.html
简洁高效,如同官网的介绍。安装过程非常简单,官网有非常详细的文档,安装文档;并且还是中文的哦!
安装完成后需要部署至github,根据官网的介绍,首先进行配置
安装hexo关于git管理组件:hexo-delopyer-git,照着做即可
找到根目录下的_config.yml,修改配置
deploy: type: git repo: https://github.com/pyrinelaw/pyrinelaw.github.io.git branch: master
hexo d
Error: spawn git ENOENT at exports._errnoException (util.js:746:11) at Process.ChildProcess._handle.onexit (child_process.js:1053:32) at child_process.js:1144:20) at process._tickCallback (node.js:355:11)
未添加Git环境变量引起,添加Git与git管理库的环境变量即可;
D:/Git/bin;D:/Git/libexec/git-core
设置完毕后强制更新环境变量,或者重启电脑~
Please make sure you have the correct access rights and the repository exists. FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io cs/troubleshooting.html Error: fatal: 'github.com/pyrinelaw/pyrinelaw.github.io.git' does not appear be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
读取不到github上的分支,使用Hexo之前是有使用Git操作过Github的,所以不大可能是Git安装的问题。
ssh -v git@github.com
显示ssh连接github成功,说明Git安装正确。
卸载Git重新安装,错误继续出现。搁置了一天,中午午休的时候网上逛论坛,发现了此问题。原来是我的Git版本太新的缘故。。。
卸载Git 2.5版本,安装1.9版本,问题解决-_-
再次部署
hexo d
提示success ~
但是尼玛,居然把整个hexo根目录给提交了上去,这不是我要的结果啊,说好的只提交public文件夹的呢!@Д@
查看hexo根目录,存在“.git”这个目录,原来是在hexo根目录下,我进行过git init的操作,删除“.git”文件夹即可。
至此博客已部署至Github完毕
贴上地址: pyrinelaw.github.io
https://hexo.io/zh-cn/docs/
http://artori.us/git-github-usage/
http://www.jianshu.com/p/858ecf233db9
http://www.cognize.me/2015/08/22/msysgiterror/