docs+feat: 重构规格与 Gitea 式 SSR 骨架(首页)

在 rebuild/gitea-ssr 落地产品规格、Cursor 规则,以及 Go 模板 SSR 首页/板块列表;未迁移路径仍回落 SPA,便于对照 main。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-29 03:11:25 +08:00
parent 4dc3bbb13f
commit 1414c71dec
28 changed files with 2891 additions and 24 deletions

51
templates/base.tmpl Normal file
View File

@@ -0,0 +1,51 @@
{{define "base"}}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{{.Title}}</title>
{{if .Description}}<meta name="description" content="{{.Description}}"/>{{end}}
<link rel="stylesheet" href="/ssr-assets/site.css"/>
</head>
<body class="j13-body">
<header class="j13-header">
<div class="j13-header__inner">
<a class="j13-brand" href="/">
<span class="j13-brand__mark">{{.LogoMark}}</span>
<span class="j13-brand__text">
<strong>{{.SiteName}}</strong>
{{if .Slogan}}<span class="j13-brand__slogan">{{.Slogan}}</span>{{end}}
</span>
</a>
<nav class="j13-nav">
{{if .LoggedIn}}
<a href="/compose">发帖</a>
<a href="/messages">消息</a>
<a href="/profile">{{.ViewerName}}</a>
{{if .IsAdmin}}<a href="/admin/dashboard">后台</a>{{end}}
{{else}}
<a href="/login">登录</a>
<a href="/register">注册</a>
{{end}}
</nav>
</div>
</header>
<div class="j13-layout">
<aside class="j13-aside j13-aside--left">
<a class="j13-aside__link{{if eq .ActiveBoard 0}} is-active{{end}}" href="/">全部帖子</a>
{{range .Boards}}
<a class="j13-aside__link{{if eq $.ActiveBoard .ID}} is-active{{end}}" href="/board/{{.ID}}">{{.Name}}</a>
{{end}}
</aside>
<main class="j13-main">
{{template "content" .}}
</main>
</div>
<footer class="j13-footer">
<p>{{.SiteName}} · Gitea 式 SSR 骨架</p>
</footer>
<script src="/ssr-assets/site.js" defer></script>
</body>
</html>
{{end}}