This commit is contained in:
toom1996
2026-09-22 21:40:04 +08:00
parent c32347ed3c
commit c3a6baa419
25 changed files with 2051 additions and 783 deletions

View File

@ -0,0 +1,26 @@
{{/*
后台页面外壳:<head> + 共享样式/脚本 + 页面内容插槽。
页面模板只需提供三个 define:
{{define "title"}} 浏览器标题
{{define "content"}} 正文(含自己的 .bar / .main 容器)
需要顶部导航时,在 content 里写 {{template "bar" .}}(登录页不需要,故不引用)。
样式与脚本走 /admin/assets/(同样是 embed 进二进制,零外部依赖、零构建):
CSS 独立成文件后浏览器可跨页缓存,也才有真正的 CSS 语法高亮与补全。
*/}}
{{define "layout"}}<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>{{template "title" .}}</title>
<link rel="stylesheet" href="/admin/assets/admin.css">
</head>
<body>
{{template "content" .}}
<div id="toast" class="flash ok" hidden></div>
<script src="/admin/assets/admin.js" defer></script>
</body>
</html>
{{end}}