通过GitHub和Hexo来搭建自己的个人博客 2019-01-25


title: 通过GitHub和Hexo来搭建自己的个人博客

参考:
通过GitHub和Hexo来搭建自己的个人博客
Hexo 使用中遇到的问题总结
利用Hexo在多台电脑上提交和更新github pages博客
github+hexo搭建自己的博客【真正的从0到1】20180122为准
Hexo搭建教程
Hexo搭建Github静态博客
资源:
淘宝 NPM 镜像

注意事项

1.部署的时候执行:hexo deploy 命令行没有任何输出,也没有错误

解决办法: 
在部署的_config.yml文件中,找到deploy:标签,在每个冒号后面必须要空格,否则就会出现上述问题。我的配置如下:


deploy:
type: git
repository: https://github.com/wx962464/wx962464.github.io.git
branch: master

2.部署提示找不到git

解决办法: 
在Hexo 3.0版本后deploy git 被分开的,所以需要安装,安装命令如下:npm install hexo-deployer-git --save ,安装好后在尝试一下就ok。

3. 执行 npm install -g hexo-cli 一直在等待,没有反应

$ 是npm官方镜像连不通的问题. 尝试用淘宝的npm镜像后可以。执行 npm config set registry "https://registry.npm.taobao.org" 将npm包源指向淘宝。

$ npm install -g cnpm --registry=https://registry.npm.taobao.org

4. 绑定域名

$ 域名绑定 当前只对其 的主机记录和 记录值 进行了一次处理,发现可行
Image text

6. hexo d 报的错误,找不到 github .

FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: fatal: HttpRequestException encountered.
           ʱ    
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error

    at ChildProcess.<anonymous> (D:\hexo\node_modules\hexo-util\lib\spawn.js:37:17)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at ChildProcess.cp.emit (D:\hexo\node_modules\cross-spawn\lib\enoent.js:40:29)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

通过改变

根目录下的 _config.yml 
将 repo: https://github.com/houyongliang.../blog.git 改为 repo: git@github.com:houyongliang.../blog.git


©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容