Merge branch 'devel'

This commit is contained in:
Jason Streifling 2024-08-31 01:00:55 +02:00
commit c3c0650210
3 changed files with 7 additions and 2 deletions

View File

@ -23,6 +23,10 @@ func GenerateRSS(c *Config, db *DB) (*string, error) {
} }
for _, article := range articles { for _, article := range articles {
if !article.Published {
continue
}
tags, err := db.GetArticleTags(article.ID) tags, err := db.GetArticleTags(article.ID)
if err != nil { if err != nil {
return nil, fmt.Errorf("error getting tags for articles for RSS feed: %v", err) return nil, fmt.Errorf("error getting tags for articles for RSS feed: %v", err)

View File

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

View File

@ -502,7 +502,7 @@ func UploadArticleImage(c *b.Config, s *b.CookieStore) http.HandlerFunc {
return 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") w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(url) json.NewEncoder(w).Encode(url)
} }