Make atom feed compatible with multiple authors
This commit is contained in:
parent
81f0e46ba6
commit
8fb0733908
@ -51,12 +51,18 @@ func GenerateAtomFeed(c *Config, db *DB) (*string, error) {
|
||||
entry.Links[linkID].Type = "image/webp"
|
||||
}
|
||||
|
||||
user, err := db.GetUser(c, article.AuthorID)
|
||||
authors, err := db.GetArticleAuthors(c, article.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting article's authors for Atom feed: %v", err)
|
||||
}
|
||||
for _, author := range authors {
|
||||
user, err := db.GetUser(c, author.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting user info for Atom feed: %v", err)
|
||||
}
|
||||
authorID := entry.AddAuthor(atom.NewPerson(user.FirstName + " " + user.LastName))
|
||||
entry.Authors[authorID].URI = c.Domain + "/image/serve/" + user.ProfilePicLink
|
||||
}
|
||||
|
||||
tags, err := db.GetArticleTags(article.ID)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user