这个站是怎么搭起来的
把搭建过程记一下,以后自己回头翻也方便。
技术栈
- nginx 托管静态文件
- Let's Encrypt 免费证书,certbot 自动续期
- 一个 Python 脚本,把 Markdown 渲染成 HTML
目录结构
/var/www/www.s1eep.vip
├── content/ 文章源码(Markdown)
├── templates/ 页面外壳
├── static/ CSS、图标
├── public/ 生成结果,nginx 指向这里
└── build.py 构建脚本
写一篇新文章
- 在
content/posts/里新建文件,名字用日期-短标题.md,比如2026-10-13-周末.md - 开头写上元信息:
---
title: 周末
date: 2026-10-13
summary: 列表页显示的一句话摘要
---
- 正文用 Markdown 随便写
- 跑一次构建:
cd /var/www/www.s1eep.vip && python3 build.py
刷新页面就能看到。
摘要可以省略,脚本会自己从正文里截一段。