Compare commits
2 Commits
7afe8316a9
...
53f4fc363a
Author | SHA1 | Date | |
---|---|---|---|
|
53f4fc363a | ||
|
005827e65a |
9
main.go
9
main.go
@ -20,7 +20,7 @@ import (
|
||||
_ "embed"
|
||||
)
|
||||
|
||||
const VERSION = "v0.3.0";
|
||||
const VERSION = "v6";
|
||||
const LISTEN_HOST = "0.0.0.0";
|
||||
const DB_SCHEMA = 10
|
||||
|
||||
@ -112,7 +112,12 @@ func staticHandler(w http.ResponseWriter, r *http.Request) {// {{{
|
||||
// To get rid of problems with cached content in browser on a new version release,
|
||||
// while also not disabling cache altogether.
|
||||
log.Printf("static: %s", r.URL.Path)
|
||||
rxp := regexp.MustCompile("^/(css|images|js|fonts)/v[0-9]+\\.[0-9]+\\.[0-9]+/(.*)$")
|
||||
if r.URL.Path == "/favicon.ico" {
|
||||
static.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
rxp := regexp.MustCompile("^/(css|images|js|fonts)/v[0-9]+/(.*)$")
|
||||
if comp := rxp.FindStringSubmatch(r.URL.Path); comp != nil {
|
||||
r.URL.Path = fmt.Sprintf("/%s/%s", comp[1], comp[2])
|
||||
static.ServeHTTP(w, r)
|
||||
|
BIN
static/favicon.ico
Normal file
BIN
static/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
@ -5,8 +5,6 @@
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" />
|
||||
<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/main.css">
|
||||
<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/login.css">
|
||||
<script type="text/javascript" src="/js/{{ .VERSION }}/lib/sjcl.js"></script>
|
||||
<script type="text/javascript" src="/js/{{ .VERSION }}/lib/css_reload.js"></script>
|
||||
<script type="importmap">
|
||||
{
|
||||
"imports": {
|
||||
@ -24,6 +22,8 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="/js/{{ .VERSION }}/lib/sjcl.js"></script>
|
||||
<script type="text/javascript" src="/js/{{ .VERSION }}/lib/css_reload.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user