【问题标题】:Hexo deploy on githubHexo 部署在 github
【发布时间】:2018-04-15 12:52:29
【问题描述】:

我尝试在我的 GithubPage 上部署 Hexo

生成过程看起来不错,但是当我将它部署到我的 GithubPage 时发生错误。

这是 _config.yml 中的部署部分:

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: https://github.com/ZhangYuef/ZhangYuef.github.io.git
# branch: Hexo

生成

部署

那么那里发生了什么? 谢谢帮助! :)

【问题讨论】:

    标签: node.js github-pages hexo


    【解决方案1】:

    您在问题中提供的上下文不充分...

    但是根据截图上的无效字符,我想你的中文文件路径可能是原因。

    参考资料:

    【讨论】:

      【解决方案2】:

      尝试像这样更新 _config.yml:

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

      yaml 非常非常非常严格,缩进很重要!

      【讨论】:

        【解决方案3】:

        不确定导致此错误的原因。 检查你的环境是否已经设置了这些东西。 我认为可能是您的配置类型错误。

        • npm install hexo-deployer-git --save

        • git 存储库设置,如

        deploy: - type: git repo: git@github.com:xxx.git branch: master - type: git repo: git@github.com:xxx.git branch: src extend_dirs: / ignore_hidden: false ignore_pattern: public: . 通过这种方式,您不仅可以部署您的博客,还可以备份您的博客文件,您可以使用命令git pull 获取另一台机器上的博客文件。 - 设置你的 ssh ssh-keygen -t rsa -C "yourEmail@icloud.com" ssh-agent -s chmod id_rsa 600 ssh-add id_rsa (you need to add the id_rsa.pub to the github's deployer key) ssh -T git@github.com

        • 有时你可能有几个 git,让部署者感到困惑。 尝试删除.git目录并确保其他目录中没有任何git。

        • 编码。可能是编码不同。就我而言,我让所有文件都属于UTF-8

        • 顺便说一下,可能是你的文件错误。试试npm install hexo-server --savehexo server来检测网站是否可以部署。 (http://localhost:4000/xx)

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多