Skip to content

Commit 2545ba8

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

File tree

3 files changed

+164
-732
lines changed

3 files changed

+164
-732
lines changed

scripts/generate-atom-feed.mjs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,18 @@ 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+
//console.log(post. authors);
32+
const authors = post.authors.map(author => `<author><name>${author}</name></author>`).join(',');
3133
feed.addItem({
3234
title: post.title,
3335
id: post.link,
3436
link: post.link,
3537
date: new Date(post.date),
36-
author: [{ name: post.authors }],
37-
content: `${imageHtml}${summaryHtml}`
38-
39-
38+
author: [{ name: `${authors}`}],
39+
content: `${image}${summary}`
4040
});
41-
4241
})
4342
return feed;
4443
}

0 commit comments

Comments
 (0)