Files
kevin 87a85ef7ca fix(web): 静态资源内嵌二进制,修复 install.sh 部署后 /static 404 导致写邮件页无编辑器
- 线上经 install.sh 部署时只复制二进制 + templates,internal/web/static
  未被复制,/static/vendor/quill/* 全部 404,Quill 加载失败正文不可输入
- 改为 go:embed 把 Quill css/js 编译进二进制,engine.StaticFS 提供,
  运行期不再依赖部署目录/工作目录,杜绝同类部署遗漏
- 已验证:移除磁盘 static 目录后静态资源仍可正常提供
2026-08-20 01:46:43 +08:00

14 lines
440 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package web
// 静态资源内嵌进二进制:install.sh 只部署二进制 + templates
// 此前 internal/web/static/ 未被复制导致线上 /static 全部 404。
// go:embed 使前端资源自包含,不再依赖部署目录与工作目录。
import "embed"
// staticFS 包含 internal/web/static/ 下的全部静态资源
// (目前为本地化的 Quill 编辑器 css/js)。
//
//go:embed all:static
var staticFS embed.FS