Skip to content

Commit 442776f

Browse files
Fix issue to display all authors of a blogpost.
1 parent bd9d5c6 commit 442776f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

scripts/generate-atom-feed.mjs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,17 @@ const generateAtomFeedFromBlogDetails = (feed, blogpostsDetails, nbOfBlogPosts)
2626
};
2727

2828
posts.forEach((post) => {
29-
const imageHtml = `<img src="${post.image}" alt="Image for ${post.title}" style="max-width:100%; height:auto;" />`;
30-
const summaryHtml = `<p>${post.summary}</p>`;
29+
const image= `<img src="${post.image}" alt="Image for ${post.title}" style="max-width:100%; height:auto;" />`;
30+
const summary = `<p>${post.summary}</p>`;
31+
const authors = post.authors.map(author => `<author><name>${author}</name></author>`).join(',');
3132
feed.addItem({
3233
title: post.title,
3334
id: post.link,
3435
link: post.link,
3536
date: new Date(post.date),
36-
author: [{ name: post.authors }],
37-
content: `${imageHtml}${summaryHtml}`
38-
39-
37+
author: `${authors}`,
38+
content: `${image}${summary}`
4039
});
41-
4240
})
4341
return feed;
4442
}

0 commit comments

Comments
 (0)