pass hub version through html and update dependencies

- Changed Vite configuration to replace version during development.
This commit is contained in:
henrygd
2025-03-13 02:15:03 -04:00
parent 1d7c0ebc27
commit ae22334645
8 changed files with 195 additions and 323 deletions

View File

@@ -172,6 +172,7 @@ func (h *Hub) startServer(se *core.ServeEvent) error {
basePath := strings.TrimSuffix(parsedURL.Path, "/") + "/"
indexFile, _ := fs.ReadFile(site.DistDirFS, "index.html")
indexContent := strings.ReplaceAll(string(indexFile), "./", basePath)
indexContent = strings.Replace(indexContent, "{{V}}", beszel.Version, 1)
// set up static asset serving
staticPaths := [2]string{"/static/", "/assets/"}
serveStatic := apis.Static(site.DistDirFS, false)