Skip to content

Commit 499be30

Browse files
Merge pull request #253 from HaudinFlorence/fix_authors_in_atom_feed
Follow up PR 251: enable to display all authors of a blogpost
2 parents bd9d5c6 + aaf3c2a commit 499be30

File tree

3 files changed

+165
-266
lines changed

3 files changed

+165
-266
lines changed

scripts/generate-atom-feed.mjs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,23 @@ const generateAtomFeedFromBlogDetails = (feed, blogpostsDetails, nbOfBlogPosts)
2020
link: blogpost.url,
2121
summary: blogpost.summary,
2222
date: new Date(blogpost.date),
23-
authors: blogpost.authors.split(','),
23+
authors: blogpost.authors,
2424
image: blogpost.image
2525
})
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+
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: [{ name: post.authors}],
38+
content: `${image}${summary}`
4039
});
41-
4240
})
4341
return feed;
4442
}

0 commit comments

Comments
 (0)