diff --git a/main.go b/main.go index 3af8274..54d2325 100644 --- a/main.go +++ b/main.go @@ -39,6 +39,7 @@ func main() { } mux := &gemini.Mux{} + mux.HandleFunc("/favicon.txt", processFavicon) mux.HandleFunc("/", process) server := &gemini.Server{ @@ -54,8 +55,13 @@ func main() { } } +func processFavicon(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) { + fmt.Fprintf(w, "\u263d") +} + func process(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) { fmt.Println(ctx, r, r.URL, r.Host) + renderIndex("en", w) } @@ -87,9 +93,7 @@ func renderIndex(lang string, w gemini.ResponseWriter) { fmt.Println(c, count) categories = categories + fmt.Sprintf("=> /%s%s/%s %s (%d)\n", langPath, "tree/path", c, c, count) } - fmt.Println(page, categories) page = strings.Replace(page, "{{categories}}", categories, 1) - fmt.Println(page) tags := "" for t, count := range tree.Tags {