2023-02-20 15:19:44 +08:00
2021-11-14 14:32:08 +08:00
2023-02-20 15:19:44 +08:00
2021-11-30 21:55:28 +08:00
2021-11-14 14:32:08 +08:00
2021-11-14 14:40:37 +08:00
2022-09-24 08:17:23 +08:00
2022-11-25 11:47:24 +08:00

个人博客

介绍

  • 该博客由 hugo 生成
  • 使用 even 主题

编辑

  • 获取博客 md 文件

    git clone https://git.colben.cn/colben/www.colben.cn.git
    
  • 获取主题

    cd www.colben.cn
    git clone https://github.com/olOwOlo/hugo-theme-even.git themes/even
    
  • 本地编译,生成页面,仅用于本地调试,不会提交

    hugo --baseURL="https://www.colben.cn/"
    
  • 提交和推送

    git commit -a -m 'update info'
    git push
    

发布

  • 配置本仓库的 post-receive 钩子,内容如下

    set -euo pipefail
    
    exec &> /var/log/gitea/post-receive.log
    date +'[%F %T] Update www.colben.cn ...'
    cd /html/www.colben.cn
    env -i git pull origin master
    hugo
    
  • 克隆本仓库的前端目录

    docker exec -ti gitea /bin/bash # 进入 gitea 容器
    apk update
    apk add --no-cache hugo # 安装 hugo
    chown gitea.www-data /html
    su - gitea
    cd /html
    git clone https://git.colben.cn/colben/www.colben.cn.git
    cd www.colben.cn
    hugo
    exit # 退出容器
    
Description
个人博客
Readme 5.8 MiB
Languages
HTML 100%