favicon.txt
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Arnas Udovicius 2022-08-18 02:49:38 +03:00
parent 37f4cfaade
commit fcb49aa38c

View file

@ -39,6 +39,7 @@ func main() {
} }
mux := &gemini.Mux{} mux := &gemini.Mux{}
mux.HandleFunc("/favicon.txt", processFavicon)
mux.HandleFunc("/", process) mux.HandleFunc("/", process)
server := &gemini.Server{ 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) { func process(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) {
fmt.Println(ctx, r, r.URL, r.Host) fmt.Println(ctx, r, r.URL, r.Host)
renderIndex("en", w) renderIndex("en", w)
} }
@ -87,9 +93,7 @@ func renderIndex(lang string, w gemini.ResponseWriter) {
fmt.Println(c, count) fmt.Println(c, count)
categories = categories + fmt.Sprintf("=> /%s%s/%s %s (%d)\n", langPath, "tree/path", c, 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) page = strings.Replace(page, "{{categories}}", categories, 1)
fmt.Println(page)
tags := "" tags := ""
for t, count := range tree.Tags { for t, count := range tree.Tags {