Hexo部署GitHub Pages

hexo

环境要求

  • node.js > 10.13
  • git
  • Hexo
  • 默认你知道Hexo的使用方法

创建一个仓库(repository)

  • 进入GitHub,右上角点击 New repository

  • 将Repository name设置成 你的用户名.github.io ,注意,用户名必须跟你的一模一样

  • 复制GitHub连接 git@github.com:Chenilove/Chenilove.github.io.git ,注意这里用HTTPS的话每次提交都要登录,推荐SSH

  • 在Hexo项目根目录下,编辑_config.yml文件,里面修改

    # Deployment
    ## Docs: https://hexo.io/docs/one-command-deployment
    deploy:
      - type: git # 提交类型git
        repo: git@github.com:Chenilove/Chenilove.github.io.git # 提交仓库地址
       branch: main # 分支GitHub的默认分支是main Gitee的分支是master 可以填branch让hexo默认提交
       message: message # 提交信息
    
  • 安装插件

npm install hexo-deployer-git --save

issues

  • 执行hexo d每次都要登录是怎么回事?

    _config.yml里的repo改成SSH(git@github.com)的链接就行了

posted @ 2020-12-15 10:24  遗失的美好灬  阅读(79)  评论(0编辑  收藏  举报