From 989e28bbdd271c30d4cf5ccee563db6c72b227c2 Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Tue, 28 Nov 2023 22:25:47 -0500 Subject: [PATCH] [fix] assets regression --- api/app-routes.go | 17 +++++++++-------- assets/local/{index.html => index.htm} | 0 assets/reader/{index.html => index.htm} | 0 3 files changed, 9 insertions(+), 8 deletions(-) rename assets/local/{index.html => index.htm} (100%) rename assets/reader/{index.html => index.htm} (100%) diff --git a/api/app-routes.go b/api/app-routes.go index c6557b1..e7139f2 100644 --- a/api/app-routes.go +++ b/api/app-routes.go @@ -72,23 +72,24 @@ type requestDocumentAdd struct { func (api *API) webManifest(c *gin.Context) { c.Header("Content-Type", "application/manifest+json") - c.FileFromFS("./assets/manifest.json", http.FS(api.Assets)) + c.FileFromFS("assets/manifest.json", http.FS(api.Assets)) } func (api *API) serviceWorker(c *gin.Context) { - c.FileFromFS("./assets/sw.js", http.FS(api.Assets)) + c.FileFromFS("assets/sw.js", http.FS(api.Assets)) } func (api *API) faviconIcon(c *gin.Context) { - c.FileFromFS("./assets/icons/favicon.ico", http.FS(api.Assets)) + c.FileFromFS("assets/icons/favicon.ico", http.FS(api.Assets)) } func (api *API) localDocuments(c *gin.Context) { - c.FileFromFS("./assets/local/index.html", http.FS(api.Assets)) + c.FileFromFS("assets/local/index.htm", http.FS(api.Assets)) } func (api *API) documentReader(c *gin.Context) { - c.FileFromFS("./assets/reader/index.html", http.FS(api.Assets)) + c.FileFromFS("assets/reader/index.htm", http.FS(api.Assets)) + } func (api *API) createAppResourcesRoute(routeName string, args ...map[string]any) func(*gin.Context) { @@ -284,7 +285,7 @@ func (api *API) getDocumentCover(c *gin.Context) { // Handle Identified Document if document.Coverfile != nil { if *document.Coverfile == "UNKNOWN" { - c.FileFromFS("./assets/images/no-cover.jpg", http.FS(api.Assets)) + c.FileFromFS("assets/images/no-cover.jpg", http.FS(api.Assets)) return } @@ -295,7 +296,7 @@ func (api *API) getDocumentCover(c *gin.Context) { _, err = os.Stat(safePath) if err != nil { log.Error("[getDocumentCover] File Should But Doesn't Exist:", err) - c.FileFromFS("./assets/images/no-cover.jpg", http.FS(api.Assets)) + c.FileFromFS("assets/images/no-cover.jpg", http.FS(api.Assets)) return } @@ -348,7 +349,7 @@ func (api *API) getDocumentCover(c *gin.Context) { // Return Unknown Cover if coverFile == "UNKNOWN" { - c.FileFromFS("./assets/images/no-cover.jpg", http.FS(api.Assets)) + c.FileFromFS("assets/images/no-cover.jpg", http.FS(api.Assets)) return } diff --git a/assets/local/index.html b/assets/local/index.htm similarity index 100% rename from assets/local/index.html rename to assets/local/index.htm diff --git a/assets/reader/index.html b/assets/reader/index.htm similarity index 100% rename from assets/reader/index.html rename to assets/reader/index.htm