搭建博客

  • 网站:https://hexo.io/api/
  • 步骤:
  • npm install hexo-cli -g 安装全局命令hexo
  • hexo init blog(文件夹的名字)
  • cd blog
  • npm install
  • hexo server

    发布的网站(发布到github上)->在当前项目下安装

  • 安装
    • npm install hexo-deployer-git –save
  • 发布:(创建仓库)->在线上github操作
    • 用户名.github.io(唯一的)
  • 配置发布命令:

    1
    2
    3
    4
    deploy:
    type:git
    repo:http://zuyuan:xy19921004@github.com/zuyuan/zuyuan.github.io.git
    branch:master
    大专栏  搭建博客>
  • hexo g生成html

  • hexo d发布项目

    每次更新,需要重新生成和发布,操作git时,永远在根路径下操作

更换博客主体

  • 现将选好的主体网址克隆到本地git clone +网址
  • 在_config中修改theme属性,在source中修改博客内容
  • hexo g生成html
  • hexo d发布项目
原文地址:https://www.cnblogs.com/lijianming180/p/12432908.html