1
0
Fork 0

Added /favicon.ico.

This commit is contained in:
Alexander Andreev 2023-06-04 17:48:49 +04:00
parent 21cf1e3f51
commit af1af0764e
Signed by: Arav
GPG Key ID: D22A817D95815393
3 changed files with 6 additions and 0 deletions

View File

@ -79,6 +79,7 @@ func main() {
}
r.ServeStatic("/assets/*filepath", web.Assets())
r.Handler(http.MethodGet, "/favicon.ico", dwhttp.FaviconIco)
r.Handler(http.MethodGet, "/robots.txt", dwhttp.RobotsTxt)
r.Handler(http.MethodGet, "/rss.xml", hand.RSS)
r.Handler(http.MethodGet, "/sitemap.xml", dwhttp.SitemapXml)

View File

@ -162,6 +162,11 @@ func (h *Handlers) RSS(w http.ResponseWriter, r *http.Request) {
web.RSS(r.URL.Scheme+"://"+r.Host, "Arav", posts, r, w)
}
func FaviconIco(w http.ResponseWriter, r *http.Request) {
data, _ := web.AssetsGetFile("img/favicon.ico")
w.Write(data)
}
func RobotsTxt(w http.ResponseWriter, r *http.Request) {
data, _ := web.AssetsGetFile("robots.txt")
w.Write(data)

BIN
web/assets/img/favicon.ico Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB