0%

博客踩坑备忘

安装nodejs

  • 更换淘宝源:npm config set registry https://registry.npm.taobao.org

  • 安装hexo框架:

    ​ npm install hero-cli -g

    ​ npm install hero-deployer-git

  • 建立本地博客仓库:

    ​ hexo init

    ​ hexo new demo ## 生成博客

    ​ hexo g ## 生成静态文件配置

    ​ hexo d ## 部署代码

创建GitHub仓库

  • 建立GitHub仓库:RoacherM.github.io

  • 链接Github仓库:修改博客文件夹中的_config.yml文件

    1
    2
    3
    4
    deploy:
    type: git
    repository: “你的仓库地址”
    branch: “你的分支” # 建议新建一个,main分支只保留基础信息比较合适

链接阿里云域名

  • 域名解析:

    CNAME

​ 添加CNAME

​ 在GitHub主页settings->option中找到Custom Options,将你的域名www.houpsite.com写进去,保存