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 {
|
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)
|
||||||
|
@ -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)
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user