feat: 青主题产品壳与静态资源版本号

对齐 SPA 顶栏工具条与清青强调色,CSS/JS 带构建 ?v= 长缓存穿透。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-30 05:43:25 +08:00
parent 3bd0b990a1
commit e0683ef262
15 changed files with 827 additions and 554 deletions

View File

@@ -6,7 +6,7 @@
{{range .FooterPages}} · <a href="/page/{{.Slug}}">{{.Title}}</a>{{end}}
</p>
</footer>
<script src="/ssr-assets/site.js" defer></script>
<script src="/ssr-assets/site.js?v={{.AssetVersion}}" defer></script>
</body>
</html>
{{end}}

View File

@@ -10,8 +10,7 @@
<meta property="og:title" content="{{.Title}}"/>
{{if .Description}}<meta property="og:description" content="{{.Description}}"/>{{end}}
{{if .OGImageURL}}<meta property="og:image" content="{{.OGImageURL}}"/>{{end}}
<link rel="stylesheet" href="/ssr-assets/site.css"/>
{{/* 西文优先 IBM Plex本机有则用见 10-design-system不外链 CDN */}}
<link rel="stylesheet" href="/ssr-assets/site.css?v={{.AssetVersion}}"/>
</head>
<body class="j13-body">
{{end}}

View File

@@ -12,27 +12,41 @@
{{if .Slogan}}<span class="j13-brand__slogan">{{.Slogan}}</span>{{end}}
</span>
</a>
<nav class="j13-nav">
<button type="button" class="j13-theme-toggle" id="j13-theme-toggle" aria-label="切换主题" title="切换主题">主题</button>
<a href="/#search">搜索</a>
<a href="/boards">板块</a>
{{if .ShowFriendLinksNav}}<a href="/links">友链</a>{{end}}
{{range .NavPages}}<a href="/page/{{.Slug}}">{{.Title}}</a>{{end}}
<form class="j13-header-search" method="get" action="/" role="search">
<label class="j13-header-search__label">
<span class="j13-visually-hidden">搜索帖子</span>
<input type="search" name="keyword" placeholder="搜索帖子…" autocomplete="off"/>
</label>
</form>
<div class="j13-header__actions">
{{if .LoggedIn}}
<a href="/compose">发帖</a>
<a href="/messages">私信{{if gt .UnreadCount 0}} <span class="j13-badge">{{.UnreadCount}}</span>{{end}}</a>
<a href="/favorites">收藏</a>
<a href="/profile">{{.ViewerName}} · {{.ViewerPoints}} 积分</a>
{{if .IsAdmin}}<a href="/admin/dashboard">后台</a>{{end}}
<form class="j13-inline-form" method="post" action="/logout">
<input type="hidden" name="_csrf" value="{{.CSRF}}"/>
<button type="submit" class="j13-linkbtn">退出</button>
</form>
<a class="j13-btn j13-btn--compose" href="/compose">发帖</a>
{{else}}
<a href="/register">注册</a>
<a href="/login">登录</a>
<a class="j13-btn j13-btn--compose" href="/login">登录</a>
<a class="j13-header__textlink" href="/register">注册</a>
{{end}}
</nav>
<button type="button" class="j13-theme-toggle" id="j13-theme-toggle" aria-label="切换主题" title="切换主题">主题</button>
{{if .LoggedIn}}
<a class="j13-header__iconlink" href="/messages" title="私信">私信{{if gt .UnreadCount 0}} <span class="j13-badge">{{.UnreadCount}}</span>{{end}}</a>
<a class="j13-header__user" href="/profile" title="个人中心">{{.ViewerName}} · {{.ViewerPoints}}</a>
{{end}}
<details class="j13-more">
<summary>更多</summary>
<div class="j13-more__menu" role="menu">
<a href="/boards" role="menuitem">板块</a>
{{if .ShowFriendLinksNav}}<a href="/links" role="menuitem">友链</a>{{end}}
{{range .NavPages}}<a href="/page/{{.Slug}}" role="menuitem">{{.Title}}</a>{{end}}
{{if .LoggedIn}}
<a href="/favorites" role="menuitem">收藏</a>
{{if .IsAdmin}}<a href="/admin/dashboard" role="menuitem">后台</a>{{end}}
<form method="post" action="/logout">
<input type="hidden" name="_csrf" value="{{.CSRF}}"/>
<button type="submit" role="menuitem">退出</button>
</form>
{{end}}
</div>
</details>
</div>
</div>
</header>
{{end}}

View File

@@ -8,7 +8,7 @@
<a class="{{if eq .Sort "hot"}}is-active{{end}}" href="{{.SortHref "hot"}}">热门讨论</a>
</div>
</header>
<form id="search" class="j13-search" method="get" action="{{.FormAction}}" role="search">
<form id="search" class="j13-search j13-search--toolbar" method="get" action="{{.FormAction}}" role="search">
{{if and .Sort (ne .Sort "latest")}}<input type="hidden" name="sort" value="{{.Sort}}"/>{{end}}
<div class="j13-search__row">
<label class="j13-search__field">
@@ -44,7 +44,7 @@
{{if .BoardName}}<span class="j13-tag">{{.BoardName}}</span>{{end}}
<span>{{.AuthorName}}</span>
<span>{{.CreatedLabel}}</span>
<span>{{.CommentCount}} 回复</span>
<span class="j13-post-item__replies">{{.CommentCount}} 回复</span>
</div>
</li>
{{end}}