From 2ce25811afe7e1c26ae48bc288334d1e9fdfb243 Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Wed, 16 Jun 2021 01:35:24 +0500 Subject: [PATCH] Reintroduce favicons Store it at the static folder, like before. I created a new config field for that originally, but then I understood that it is to be thrown away anyway when the Structure comes, so decided to keep it the old way. --- web/stuff.go | 3 +++ web/web.go | 1 + 2 files changed, 4 insertions(+) diff --git a/web/stuff.go b/web/stuff.go index e5b2870..d4ffd4a 100644 --- a/web/stuff.go +++ b/web/stuff.go @@ -21,6 +21,9 @@ func initStuff() { http.HandleFunc("/update-header-links/", handlerUpdateHeaderLinks) http.HandleFunc("/random/", handlerRandom) http.HandleFunc("/about/", handlerAbout) + http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, rq *http.Request) { + http.Redirect(w, rq, "/static/favicon.ico", http.StatusSeeOther) + }) } // handlerList shows a list of all hyphae in the wiki in random order. diff --git a/web/web.go b/web/web.go index d76c2a2..a3a5566 100644 --- a/web/web.go +++ b/web/web.go @@ -65,6 +65,7 @@ func handlerRobotsTxt(w http.ResponseWriter, rq *http.Request) { w.Write([]byte( `User-agent: * Allow: /page/ +Allow: /hypha/ Allow: /recent-changes Disallow: / Crawl-delay: 5`))