From 4c70389b13335fc89a8c99033ac0af989b6a8537 Mon Sep 17 00:00:00 2001 From: tekstrand Date: Sat, 24 Aug 2024 17:15:31 -0500 Subject: [PATCH] blog images into rss feed --- docusaurus.config.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docusaurus.config.js b/docusaurus.config.js index ed3e59e8..31987159 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -134,6 +134,25 @@ const config = { blogTitle: "Meshtastic Blog", blogDescription: "Discover in-depth insights from developers and maintainers, including project updates and changes. Hear from the community about their projects and ideas.", + feedOptions: { + type: "rss", + createFeedItems: async ({ blogPosts, siteConfig, ...params }) => { + const feedItems = await params.defaultCreateFeedItems({ + blogPosts, + siteConfig, + ...params, + }); + feedItems.forEach((feedItem, index) => { + const blogPost = blogPosts[index]; + const imageUrl = blogPost.metadata.frontMatter.image + ? new URL(blogPost.metadata.frontMatter.image, siteConfig.url) + .href + : null; + feedItem.image = imageUrl; + }); + return feedItems; + }, + }, }, theme: { customCss: require.resolve("./src/css/custom.css"),