Fixed small bug in ServeArticle where it was looking at the link to read the file

This commit is contained in:
Jason Streifling 2024-08-31 01:00:39 +02:00
parent ab6b9b9a4f
commit bc58b1be44

View File

@ -35,7 +35,8 @@ func ServeArticle(c *b.Config, db *b.DB) http.HandlerFunc {
return
}
contentBytes, err := os.ReadFile(article.Link)
articleAbsName := fmt.Sprint(c.ArticleDir, "/", article.ID, ".md")
contentBytes, err := os.ReadFile(articleAbsName)
if err != nil {
log.Println(err)
http.Error(w, err.Error(), http.StatusInternalServerError)