frontend for pinned resources

This commit is contained in:
2025-08-28 11:28:59 +08:00
parent 1925cf404e
commit b17fa45d79
9 changed files with 137 additions and 12 deletions

View File

@@ -155,6 +155,14 @@ func serveIndexHtml(c fiber.Ctx) error {
preFetchData = url.PathEscape(string(preFetchDataJson))
}
}
} else if path == "/" || path == "" {
pinned, err := service.GetPinnedResources()
if err == nil {
preFetchDataJson, _ := json.Marshal(map[string]interface{}{
"pinned": pinned,
})
preFetchData = url.PathEscape(string(preFetchDataJson))
}
}
content = strings.ReplaceAll(content, "{{SiteName}}", siteName)