From fcd4b9b8530a326f1dc8ae7454afd72c4c3e1f8d Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Sat, 22 May 2021 23:10:32 +0500 Subject: [PATCH] Change URLs for static assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /static/... → /assets/... --- views/mutators.qtpl | 2 +- views/mutators.qtpl.go | 2 +- views/stuff.qtpl | 2 +- views/stuff.qtpl.go | 2 +- web/web.go | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/views/mutators.qtpl b/views/mutators.qtpl index c1d5182..828cac1 100644 --- a/views/mutators.qtpl +++ b/views/mutators.qtpl @@ -65,7 +65,7 @@ {% endif %} - + {% endfunc %} {% func EditHTML(rq *http.Request, hyphaName, textAreaFill, warning string) %} diff --git a/views/mutators.qtpl.go b/views/mutators.qtpl.go index 035dbc8..eaf6f10 100644 --- a/views/mutators.qtpl.go +++ b/views/mutators.qtpl.go @@ -141,7 +141,7 @@ func StreamToolbar(qw422016 *qt422016.Writer, u *user.User) { qw422016.N().S(` - + `) //line views/mutators.qtpl:69 } diff --git a/views/stuff.qtpl b/views/stuff.qtpl index 68d29a5..26117af 100644 --- a/views/stuff.qtpl +++ b/views/stuff.qtpl @@ -10,7 +10,7 @@ - + {%s title %} {% for _, el := range headElements %}{%s= el %}{% endfor %} diff --git a/views/stuff.qtpl.go b/views/stuff.qtpl.go index 5c96841..9079a25 100644 --- a/views/stuff.qtpl.go +++ b/views/stuff.qtpl.go @@ -41,7 +41,7 @@ func StreamBaseHTML(qw422016 *qt422016.Writer, title, body string, u *user.User, - + `) //line views/stuff.qtpl:14 qw422016.E().S(title) diff --git a/web/web.go b/web/web.go index 1a9df12..95b3c44 100644 --- a/web/web.go +++ b/web/web.go @@ -41,13 +41,13 @@ func httpErr(w http.ResponseWriter, status int, name, title, errMsg string) { func handlerStyle(w http.ResponseWriter, rq *http.Request) { util.PrepareRq(rq) - if _, err := os.Stat(cfg.WikiDir + "/static/common.css"); err == nil { - http.ServeFile(w, rq, cfg.WikiDir+"/static/common.css") + if _, err := os.Stat(cfg.WikiDir + "/assets/common.css"); err == nil { + http.ServeFile(w, rq, cfg.WikiDir+"/assets/common.css") } else { w.Header().Set("Content-Type", "text/css;charset=utf-8") w.Write([]byte(assets.DefaultCSS())) } - if bytes, err := ioutil.ReadFile(cfg.WikiDir + "/static/custom.css"); err == nil { + if bytes, err := ioutil.ReadFile(cfg.WikiDir + "/assets/custom.css"); err == nil { w.Write(bytes) } } @@ -118,8 +118,8 @@ func Init() { http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, rq *http.Request) { http.ServeFile(w, rq, cfg.WikiDir+"/static/favicon.ico") }) - http.HandleFunc("/static/common.css", handlerStyle) - http.HandleFunc("/static/toolbar.js", handlerToolbar) + http.HandleFunc("/assets/common.css", handlerStyle) + http.HandleFunc("/assets/toolbar.js", handlerToolbar) http.HandleFunc("/assets/icon/", handlerIcon) http.HandleFunc("/robots.txt", handlerRobotsTxt) http.HandleFunc("/", func(w http.ResponseWriter, rq *http.Request) {