Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishrb committed Oct 10, 2024
1 parent cf0b32d commit a0c52b2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,17 @@ func (client *Client) Serve(file string) error {
if err == nil && regex.MatchString(r.URL.Path) {
// Open file and convert to html
bytes, err := readToString(dir, r.URL.Path)
if err != nil {
log.Fatal(err)
return
}
htmlContent := client.MdToHTML(bytes)

// Serve
err = serveTemplate(w, htmlStruct{Content: string(htmlContent), Darkmode: client.Dark})
if err != nil {
log.Fatal(err)
return
}
} else {
chttp.ServeHTTP(w, r)
Expand Down

0 comments on commit a0c52b2

Please sign in to comment.