diff --git a/cmd/backend/rss.go b/cmd/backend/rss.go index 35927d2..686e8c1 100644 --- a/cmd/backend/rss.go +++ b/cmd/backend/rss.go @@ -23,6 +23,10 @@ func GenerateRSS(c *Config, db *DB) (*string, error) { } for _, article := range articles { + if !article.Published { + continue + } + tags, err := db.GetArticleTags(article.ID) if err != nil { return nil, fmt.Errorf("error getting tags for articles for RSS feed: %v", err) 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) diff --git a/cmd/frontend/articles.go b/cmd/frontend/articles.go index fd6bef0..8e6263d 100644 --- a/cmd/frontend/articles.go +++ b/cmd/frontend/articles.go @@ -502,7 +502,7 @@ func UploadArticleImage(c *b.Config, s *b.CookieStore) http.HandlerFunc { return } - url := fmt.Sprint(c.Domain, "/image/serve/", filename) + url := fmt.Sprint(c.Domain, c.Port, "/image/serve/", filename) w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(url) }