Merge branch 'devel'
This commit is contained in:
commit
c3c0650210
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user