diff --git a/main.go b/main.go index 988a875..54d9ac1 100644 --- a/main.go +++ b/main.go @@ -97,11 +97,7 @@ func renderMarkdown(content string) template.HTML { content = ulPattern.ReplaceAllString(content, "
$1
") return template.HTML(content) @@ -159,15 +155,15 @@ func main() { path := strings.TrimPrefix(r.URL.Path, "/") if strings.HasSuffix(path, ".md") { postHandler(w, r) - } else if strings.Contains(path, ".") { // detect non-md files - http.ServeFile(w, r, filepath.Join(FILES_DIR, path)) // serve raw file + } else if strings.Contains(path, ".") { + http.ServeFile(w, r, filepath.Join(FILES_DIR, path)) } else { indexHandler(w, r) } }) http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) { - http.ServeFile(w, r, "static/post.gif") // or just `w.WriteHeader(http.StatusNoContent)` + http.ServeFile(w, r, "static/post.gif") })