feat: 前台标签接入 antd 组件、列表封面图、favicon 随站点 Logo 及侧栏收窄
- 前台列表/详情/标签页标签统一 antd Tag;标签页改 CheckableTagGroup 单选 (选中态由组件承接,再点已选标签回到全部);移除首页标签筛选条, 标签入口收敛至顶部「标签」页 - 公开列表新增 cover 字段(取正文第一张站内图,store.FirstImageRef), 首页条目左侧显示封面缩略图,无图条目保持纯文字 - favicon 随站点 Logo:webui.Meta.Icon 服务端注入 index.html, 前端 useSiteTitle 兜底(dev 模板占位符场景)并即时生效; 设置页「重置默认」清空 Logo 后回退内置 /favicon.svg - 后台侧栏改 antd Menu(inline 分组),宽度 256→208、窄侧栏档 224→184
This commit is contained in:
@@ -40,13 +40,14 @@ func (s *Server) handleSiteInfo(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, http.StatusOK, ss)
|
||||
}
|
||||
|
||||
// publicNoteItem 公开列表项(元信息,不含全文)。
|
||||
// publicNoteItem 公开列表项(元信息 + 封面图,不含全文)。
|
||||
type publicNoteItem struct {
|
||||
Slug string `json:"slug"`
|
||||
Title string `json:"title"`
|
||||
Summary string `json:"summary"`
|
||||
Tags []string `json:"tags"`
|
||||
Pinned bool `json:"pinned"`
|
||||
Cover string `json:"cover,omitempty"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
PublishedAt int64 `json:"published_at"`
|
||||
@@ -71,6 +72,7 @@ func (s *Server) handlePublicNotes(w http.ResponseWriter, r *http.Request) {
|
||||
items = append(items, publicNoteItem{
|
||||
Slug: n.Slug, Title: n.Title, Summary: n.Summary,
|
||||
Tags: n.Tags, Pinned: n.Pinned,
|
||||
Cover: store.FirstImageRef(n.Content),
|
||||
CreatedAt: n.CreatedAt, UpdatedAt: n.UpdatedAt, PublishedAt: n.PublishedAt,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user