个人网站终于建起来了~撒花!趟过了好多坑,写下来,以后也好给自己和别人参考。相关博客参考
hexo http://www.jianshu.com/p/465830080ea9
git下载https://git-for-windows.github.io/
廖雪峰http://www.liaoxuefeng.com/
搭建http://blog.csdn.net/jzooo/article/details/46781805
l另一篇更详细的教程http://www.jianshu.com/p/1c98aed8d92e#
主题http://theme-next.iissnan.com/getting-started.html
域名http://www.isetsuna.com/hexo/domain-dns/
Your Order Number is: 2691747824
域名解析https://www.freehao123.com/freenom-gq/
图床http://yotuku.cn/
1.在 Git Bash 中我们执行下面这一句(这是一整句的):
alias cnpm=”npm –registry=https://registry.npm.taobao.org --cache=$HOME/.npm/.cache/cnpm --disturl=https://npm.taobao.org/dist --userconfig=$HOME/.cnpmrc”
现在验证下是否可以使用淘宝的 cnpm 命令:cnpm info express
2.
继续在 Git Bash 中输入:
cnpm install hexo -server –save
cnpm install hexo-deployer-git –save
3.
- 先清除掉已经生成的旧文件:hexo clean
- 再生成一次静态文件:hexo generate
- 在本地预览下:hexo server
- 现在用浏览器访问:http://localhost:4000/
- 本地没问题之后,Ctrl + C 停掉本地预览,使用部署命令部署到 Github 上:hexo deploy,有弹出下面提示框,请输入:yes
- 访问 https://savian66.github.io/
- 新建文章hexo new page “pageName”//新建文章,位于目录/blog/source/_posts下 编辑文章
- 新建页面hexo generate
- 生成静态页面至public目录hexo server
- 开启预览访问端口(默认端口4000,’ctrl + c’关闭server)
- 将.deploy目录部署到GitHub hexo deploy
- error: failed to execute prompt script (exit code 1) fatal: could not read Username for ‘https://github.com/‘: Invalid argument
https://segmentfault.com/q/1010000003734223
我也遇到过这样的问题,不过我把_config.yml中的repository 改了成了ssh,我的_config.yml文件是这样的。
deploy: type: git repository: ssh://git@github.com/xiaoliuzi/xiaoliuzi.github.io branch: master 安装hexo后,bash: hexo: command not found
找到C:\Users\Administrator\AppData\Roaming\npm\node_modules\hexo\bin\,将此目录添加到环境变量中在配置所有的_config.yml文件时(包括theme中的),在所有的冒号:后边都要加一个空格,否则执行hexo命令会报错。 博主本人的报错为FATAL bad indentation of a mapping entry at line 72, column 15:
请确认您使用空格进行缩进(Soft tab),并确认冒号后有一个空格。