favicon
This commit is contained in:
parent
ff9c3e7f77
commit
d8c7ec2295
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -15,6 +15,7 @@ import (
|
||||||
"github.com/dballard/transmet/news"
|
"github.com/dballard/transmet/news"
|
||||||
"bytes"
|
"bytes"
|
||||||
txtTemplate "text/template"
|
txtTemplate "text/template"
|
||||||
|
"path"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetFlashes(session *sessions.Session) map[string]interface{} {
|
func GetFlashes(session *sessions.Session) map[string]interface{} {
|
||||||
|
@ -250,10 +251,18 @@ func addedHandler(w http.ResponseWriter, r *http.Request, user *user.User) {
|
||||||
ShowTemplate("added", w, map[string]interface{}{"user": user, "flashes": flashes})
|
ShowTemplate("added", w, map[string]interface{}{"user": user, "flashes": flashes})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func ServeFileHandler(res http.ResponseWriter, req *http.Request) {
|
||||||
|
fname := path.Base(req.URL.Path)
|
||||||
|
http.ServeFile(res, req, "./"+fname)
|
||||||
|
}
|
||||||
|
|
||||||
func init_route_handlers() {
|
func init_route_handlers() {
|
||||||
http.Handle("/js/", http.StripPrefix("/js/", http.FileServer(http.Dir("js/"))))
|
http.Handle("/js/", http.StripPrefix("/js/", http.FileServer(http.Dir("js/"))))
|
||||||
http.Handle("/css/", http.StripPrefix("/css/", http.FileServer(http.Dir("css/"))))
|
http.Handle("/css/", http.StripPrefix("/css/", http.FileServer(http.Dir("css/"))))
|
||||||
http.Handle("/fonts/", http.StripPrefix("/fonts", http.FileServer(http.Dir("fonts/"))))
|
http.Handle("/fonts/", http.StripPrefix("/fonts", http.FileServer(http.Dir("fonts/"))))
|
||||||
|
http.HandleFunc("/favicon.ico", ServeFileHandler)
|
||||||
|
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
<link href="/css/jquery-ui.min.css" rel="stylesheet">
|
<link href="/css/jquery-ui.min.css" rel="stylesheet">
|
||||||
<link href="/css/template.css" rel="stylesheet">
|
<link href="/css/template.css" rel="stylesheet">
|
||||||
<link href="/css/signin.css" rel="stylesheet">
|
<link href="/css/signin.css" rel="stylesheet">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Reference in New Issue