这个博客是怎么跑起来的

第一篇,先把博客自身的部署链路记下来,顺便验证一下样式和代码高亮。

整条链路:

  1. 本地 hugo new content posts/xxx.md 写文章。
  2. git push 到自托管的 Gitea
  3. Gitea Actions 的 vps-runner(host 执行器)拉代码、跑 hugo --minify
  4. 构建产物 public/ 直接 cp 到主机 /var/www/blog.m1ngdaxie.com
  5. 主机 nginx 直接 serve 静态文件,Cloudflare 在前面套 CDN + TLS。

没有容器、没有数据库,纯静态,稳。

代码高亮测试

1
2
3
4
5
6
7
package main

import "fmt"

func main() {
    fmt.Println("hello, blog")
}
1
2
3
hugo new content posts/my-first-real-post.md
git add . && git commit -m "new post" && git push
# 几十秒后自动上线

接下来

  • 写点 k3s / Tailscale 组网的踩坑
  • 整理 Go 后端的实时协作笔记
  • 也许加上 giscus 评论

如果你能看到这页且代码块有高亮,说明部署成功了 🎉