mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-12 05:20:26 +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) {
|
||||
log.Println(rq.URL)
|
||||
if _, err := os.Stat(WikiDir + "/static/common.css"); err == nil {
|
||||
http.ServeFile(w, rq, WikiDir+"/static/common.css")
|
||||
if _, err := os.Stat(util.WikiDir + "/static/common.css"); err == nil {
|
||||
http.ServeFile(w, rq, util.WikiDir+"/static/common.css")
|
||||
} else {
|
||||
w.Header().Set("Content-Type", "text/css;charset=utf-8")
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user