From 2c19a7794d9b3399c76d760e8c90fc2bdca19706 Mon Sep 17 00:00:00 2001 From: Yanislav Igonin Date: Mon, 28 Feb 2022 11:59:50 +0200 Subject: [PATCH] fix: static hosting --- build/css-renamer.go | 4 ++-- templates/components/footer.html | 2 +- templates/head/static.html | 6 +++--- templates/pages/400.html | 4 ++-- templates/pages/404.html | 4 ++-- templates/pages/500.html | 4 ++-- templates/pages/index.html | 2 +- templates/pages/thread.html | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/build/css-renamer.go b/build/css-renamer.go index ca31c2c..0cf6331 100644 --- a/build/css-renamer.go +++ b/build/css-renamer.go @@ -37,7 +37,7 @@ func getCssFilesPaths() []string { panic(err) } for _, file := range files { - paths = append(paths, "/static/styles/"+file.Name()) + paths = append(paths, "static/styles/"+file.Name()) } return paths } @@ -47,7 +47,7 @@ func createCssMap() map[string]string { var cssMap = make(map[string]string) origPaths := getCssFilesPaths() for _, origPath := range origPaths { - newPath := "/static/styles/" + randomString(10) + ".css" + newPath := "static/styles/" + randomString(10) + ".css" cssMap[origPath] = newPath } diff --git a/templates/components/footer.html b/templates/components/footer.html index 7234109..0452790 100644 --- a/templates/components/footer.html +++ b/templates/components/footer.html @@ -2,7 +2,7 @@ diff --git a/templates/head/static.html b/templates/head/static.html index a8b980d..e49152f 100644 --- a/templates/head/static.html +++ b/templates/head/static.html @@ -10,7 +10,7 @@ integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj" crossorigin="anonymous"> - - - + + + {{ end }} diff --git a/templates/pages/400.html b/templates/pages/400.html index 0057cda..4376734 100644 --- a/templates/pages/400.html +++ b/templates/pages/400.html @@ -2,7 +2,7 @@ {{ template "static" }} - + {{ template "meta-tags-static" }} @@ -13,7 +13,7 @@ Bad request diff --git a/templates/pages/404.html b/templates/pages/404.html index 614a3d4..25cfd57 100644 --- a/templates/pages/404.html +++ b/templates/pages/404.html @@ -2,7 +2,7 @@ {{ template "static" }} - + {{ template "meta-tags-static" }} @@ -13,7 +13,7 @@ Not found diff --git a/templates/pages/500.html b/templates/pages/500.html index 3215fa5..15f4fd1 100644 --- a/templates/pages/500.html +++ b/templates/pages/500.html @@ -2,7 +2,7 @@ {{ template "static" }} - + {{ template "meta-tags-static" }} @@ -13,7 +13,7 @@ All broken diff --git a/templates/pages/index.html b/templates/pages/index.html index 32a1204..edddc7b 100644 --- a/templates/pages/index.html +++ b/templates/pages/index.html @@ -3,7 +3,7 @@ {{ template "static" }} - + {{ template "meta-tags-static" }} diff --git a/templates/pages/thread.html b/templates/pages/thread.html index 4671a2f..aa6da5a 100644 --- a/templates/pages/thread.html +++ b/templates/pages/thread.html @@ -6,8 +6,8 @@ {{ template "static" }} {{ template "meta-tags-dynamic" $FirstPost }} - - + +