From bc58b1be44e3635052e620d19f488aad420cecb2 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Sat, 31 Aug 2024 01:00:39 +0200 Subject: [PATCH] Fixed small bug in ServeArticle where it was looking at the link to read the file --- cmd/calls/articles.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/calls/articles.go b/cmd/calls/articles.go index 0c327c0..1568cdd 100644 --- a/cmd/calls/articles.go +++ b/cmd/calls/articles.go @@ -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)