1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-01-20 23:36:51 +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 %}
</section>
</aside>
<script src="/static/toolbar.js"></script>
<script src="/assets/toolbar.js"></script>
{% endfunc %}
{% 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(`
</section>
</aside>
<script src="/static/toolbar.js"></script>
<script src="/assets/toolbar.js"></script>
`)
//line views/mutators.qtpl:69
}

View File

@ -10,7 +10,7 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<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>
{% for _, el := range headElements %}{%s= el %}{% endfor %}
</head>

View File

@ -41,7 +41,7 @@ func StreamBaseHTML(qw422016 *qt422016.Writer, title, body string, u *user.User,
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<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>`)
//line views/stuff.qtpl:14
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) {
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) {