Revert "fix: static hosting"

This reverts commit 2c19a7794d.
This commit is contained in:
Yanislav Igonin 2022-02-28 12:33:32 +02:00
parent 920018950b
commit edb39360d2
8 changed files with 15 additions and 15 deletions

View File

@ -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
}

View File

@ -2,7 +2,7 @@
<footer class="py-4">
<div class="container text-center">
<a href="https://github.com/yanislav-igonin/micrach" target="blank">
<img class="github-icon" src="static/icons/github.svg" alt="github icon">
<img class="github-icon" src="/static/icons/github.svg" alt="github icon">
</a>
</div>
</footer>

View File

@ -10,7 +10,7 @@
integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj"
crossorigin="anonymous">
</script>
<link rel="icon" href="static/favicon.ico"/>
<link href="static/styles/utils.css" rel="stylesheet">
<link href="static/styles/post-form.css" rel="stylesheet">
<link rel="icon" href="/static/favicon.ico"/>
<link href="/static/styles/utils.css" rel="stylesheet">
<link href="/static/styles/post-form.css" rel="stylesheet">
{{ end }}

View File

@ -2,7 +2,7 @@
<html lang="en">
<head>
{{ template "static" }}
<link href="static/styles/error-image.css" rel="stylesheet">
<link href="/static/styles/error-image.css" rel="stylesheet">
{{ template "meta-tags-static" }}
</head>
@ -13,7 +13,7 @@
<a href="/" class="error-image-link">
<img
class="error-image"
src="static/images/errors/404.png"
src="/static/images/errors/404.png"
alt="Bad request"
>
</a>

View File

@ -2,7 +2,7 @@
<html lang="en">
<head>
{{ template "static" }}
<link href="static/styles/error-image.css" rel="stylesheet">
<link href="/static/styles/error-image.css" rel="stylesheet">
{{ template "meta-tags-static" }}
</head>
@ -13,7 +13,7 @@
<a href="/" class="error-image-link">
<img
class="error-image"
src="static/images/errors/404.png"
src="/static/images/errors/404.png"
alt="Not found"
>
</a>

View File

@ -2,7 +2,7 @@
<html lang="en">
<head>
{{ template "static" }}
<link href="static/styles/error-image.css" rel="stylesheet">
<link href="/static/styles/error-image.css" rel="stylesheet">
{{ template "meta-tags-static" }}
</head>
@ -13,7 +13,7 @@
<a href="/" class="error-image-link">
<img
class="error-image"
src="static/images/errors/500.png"
src="/static/images/errors/500.png"
alt="All broken"
>
</a>

View File

@ -3,7 +3,7 @@
<head>
{{ template "static" }}
<link href="static/styles/index.css" rel="stylesheet">
<link href="/static/styles/index.css" rel="stylesheet">
{{ template "meta-tags-static" }}
</head>

View File

@ -6,8 +6,8 @@
<head>
{{ template "static" }}
{{ template "meta-tags-dynamic" $FirstPost }}
<link href="static/styles/thread.css" rel="stylesheet">
<link href="static/styles/post.css" rel="stylesheet">
<link href="/static/styles/thread.css" rel="stylesheet">
<link href="/static/styles/post.css" rel="stylesheet">
</head>
<body>