1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-01-21 07:46:52 +00:00

Change URLs for static assets

/static/... → /assets/...
This commit is contained in:
Timur Ismagilov 2021-05-22 23:10:32 +05:00
parent 06ac565e76
commit fcd4b9b853
5 changed files with 9 additions and 9 deletions

View File

@ -65,7 +65,7 @@
{% endif %} {% endif %}
</section> </section>
</aside> </aside>
<script src="/static/toolbar.js"></script> <script src="/assets/toolbar.js"></script>
{% endfunc %} {% endfunc %}
{% func EditHTML(rq *http.Request, hyphaName, textAreaFill, warning string) %} {% func EditHTML(rq *http.Request, hyphaName, textAreaFill, warning string) %}

View File

@ -141,7 +141,7 @@ func StreamToolbar(qw422016 *qt422016.Writer, u *user.User) {
qw422016.N().S(` qw422016.N().S(`
</section> </section>
</aside> </aside>
<script src="/static/toolbar.js"></script> <script src="/assets/toolbar.js"></script>
`) `)
//line views/mutators.qtpl:69 //line views/mutators.qtpl:69
} }

View File

@ -10,7 +10,7 @@
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="/static/common.css"> <link rel="stylesheet" type="text/css" href="/assets/common.css">
<title>{%s title %}</title> <title>{%s title %}</title>
{% for _, el := range headElements %}{%s= el %}{% endfor %} {% for _, el := range headElements %}{%s= el %}{% endfor %}
</head> </head>

View File

@ -41,7 +41,7 @@ func StreamBaseHTML(qw422016 *qt422016.Writer, title, body string, u *user.User,
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="/static/common.css"> <link rel="stylesheet" type="text/css" href="/assets/common.css">
<title>`) <title>`)
//line views/stuff.qtpl:14 //line views/stuff.qtpl:14
qw422016.E().S(title) qw422016.E().S(title)

View File

@ -41,13 +41,13 @@ func httpErr(w http.ResponseWriter, status int, name, title, errMsg string) {
func handlerStyle(w http.ResponseWriter, rq *http.Request) { func handlerStyle(w http.ResponseWriter, rq *http.Request) {
util.PrepareRq(rq) util.PrepareRq(rq)
if _, err := os.Stat(cfg.WikiDir + "/static/common.css"); err == nil { if _, err := os.Stat(cfg.WikiDir + "/assets/common.css"); err == nil {
http.ServeFile(w, rq, cfg.WikiDir+"/static/common.css") http.ServeFile(w, rq, cfg.WikiDir+"/assets/common.css")
} else { } else {
w.Header().Set("Content-Type", "text/css;charset=utf-8") w.Header().Set("Content-Type", "text/css;charset=utf-8")
w.Write([]byte(assets.DefaultCSS())) 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) w.Write(bytes)
} }
} }
@ -118,8 +118,8 @@ func Init() {
http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, rq *http.Request) { http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, rq *http.Request) {
http.ServeFile(w, rq, cfg.WikiDir+"/static/favicon.ico") http.ServeFile(w, rq, cfg.WikiDir+"/static/favicon.ico")
}) })
http.HandleFunc("/static/common.css", handlerStyle) http.HandleFunc("/assets/common.css", handlerStyle)
http.HandleFunc("/static/toolbar.js", handlerToolbar) http.HandleFunc("/assets/toolbar.js", handlerToolbar)
http.HandleFunc("/assets/icon/", handlerIcon) http.HandleFunc("/assets/icon/", handlerIcon)
http.HandleFunc("/robots.txt", handlerRobotsTxt) http.HandleFunc("/robots.txt", handlerRobotsTxt)
http.HandleFunc("/", func(w http.ResponseWriter, rq *http.Request) { http.HandleFunc("/", func(w http.ResponseWriter, rq *http.Request) {