new-first

重新整理hexo博客的几个关键点

  1. 主题管理
    git submodule add git@github.com:shendawei/hexo-theme-next.git themes/next
    git status会有两个文件变化
    .gitmodules 配置next module信息
    themes/next 不是实际目录文件内容,仅是next module的commit id变化信息
    Git Submodule管理项目子模块

  2. hexo init && git init流程关系
    基于hexo+github搭建独立博客.md

  3. push 报错
    error: unpack failed: unable to create temporary object directory
    去服务器查看doc.git

    1
    2
    3
    4
    5
    6
    root@iZ8vb8qvlhkywyjm3zcjwvZ:/home/git/repos# ll
    total 16
    drwxrwxr-x 3 git git 4096 Mar 31 18:26 ./
    drwxr-xr-x 6 git git 4096 Mar 28 14:25 ../
    drwxr-xr-x 7 root root 4096 Mar 31 18:26 doc.git/
    -rwxrwxr-x 1 git git 153 Mar 31 17:29 post-receive*

    权限问题 root帐户创建了仓库,删除,用git帐户创建

  4. 预览
    http://localhost:4000/
    hexo s -g

  5. 发布
    Deployment
    Docs: https://hexo.io/docs/deployment.html

    1
    2
    3
    4
    deploy:
    type: git
    repo: git@shendawei.cn:/home/git/repos/Doc.git
    branch: blog

    hexo d -g