feat(web): Go W-G11 render head links for C2–C4

Emit page.head scripts/styles with defer and asset versioning so
shell/layout, style/head, and nav when/media offline smokes pass.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-10 20:07:04 +08:00
1 parent 56df0736fa
commit 26955f4f36
4 files changed
+205 -1

No files matched your search

+11
View File
@@ -5,6 +5,7 @@ import (
"fmt"
"strings"
"github.com/marqdo/marqdo/plugins/web/internal/assets"
"github.com/marqdo/marqdo/plugins/web/internal/db"
"github.com/marqdo/marqdo/plugins/web/internal/table"
)
@@ -560,6 +561,16 @@ func headHTML(page map[string]any, defaultTitle string) string {
}
}
}
if head, ok := page["head"]; ok {
links := assets.HeadLinksFromJSON(head)
assetVersion := ""
if v, ok := page["asset_version"].(string); ok {
assetVersion = v
} else if v, ok := page["资源版本"].(string); ok {
assetVersion = v
}
s.WriteString(assets.RenderHeadLinksWithVersion(links, assetVersion))
}
return s.String()
}