mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-01-19 07:02:51 +00:00
Allow adding styles in addition to default to /static/custom.css
This commit is contained in:
parent
1604278819
commit
dcd12a4a6d
7
main.go
7
main.go
@ -119,12 +119,15 @@ func handlerRandom(w http.ResponseWriter, rq *http.Request) {
|
|||||||
|
|
||||||
func handlerStyle(w http.ResponseWriter, rq *http.Request) {
|
func handlerStyle(w http.ResponseWriter, rq *http.Request) {
|
||||||
log.Println(rq.URL)
|
log.Println(rq.URL)
|
||||||
if _, err := os.Stat(WikiDir + "/static/common.css"); err == nil {
|
if _, err := os.Stat(util.WikiDir + "/static/common.css"); err == nil {
|
||||||
http.ServeFile(w, rq, WikiDir+"/static/common.css")
|
http.ServeFile(w, rq, util.WikiDir+"/static/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(templates.DefaultCSS()))
|
w.Write([]byte(templates.DefaultCSS()))
|
||||||
}
|
}
|
||||||
|
if bytes, err := ioutil.ReadFile(util.WikiDir + "/static/custom.css"); err == nil {
|
||||||
|
w.Write(bytes)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func handlerIcon(w http.ResponseWriter, rq *http.Request) {
|
func handlerIcon(w http.ResponseWriter, rq *http.Request) {
|
||||||
|
Loading…
Reference in New Issue
Block a user