Clarify how to add images to the RSS feed#7570
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Hello! Thank you for opening your first PR to Astro’s Docs! 🎉 Here’s what will happen next:
|
|
Looks great, @tommyp ! Thank you so much for this really helpful addition. @SatanshuMishra , would you like to review this one? I'd like your approval here if you're available! |
| // Note: this will not process components or JSX expressions in MDX files. | ||
| content: sanitizeHtml(parser.render(post.body)), | ||
| content: sanitizeHtml(parser.render(post.body), { | ||
| allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img']) |
There was a problem hiding this comment.
Looks good and cross-checked with documentation for sanitize-html.
SatanshuMishra
left a comment
There was a problem hiding this comment.
I think this is a great addition. Everything LGTM! Great work :) @tommyp !
sarah11918
left a comment
There was a problem hiding this comment.
Alrighty, then Let's Get That Money, @tommyp ! Welcome to Team Docs! 🥳
|
I got a problem of it. Markdown it can actually render the content, but it cannot transform img link automatically. Example: it will render like: <img src="./test.jpg" alt="image" />But as we know, astro has its own img store path. when locally, it is |
|
@cworld1 This PR was to update the docs to explain how to parse markdown and render |
|
Hey @cworld1 , I'm unsure if it works for Vercel but I took the If this needs to be included in the docs, I can add a PR to include my solution so it's more available to everyone. |
|
Hi @billy-le ! If you've written an article, then posting it in the Discord Also, you can make a PR to our community recipes page if you'd like to add the link there! https://docs.astro.build/en/community-resources/content/#images |
|
Hi @sarah11918 , thanks for the info! I'll do that and add a PR to include my post. So far, I have received a few positive comments in the |
|
Hi @billy-le , Thank you for the solutions you have provided! I checked parts of your code and updated them along the way. I think the refined code might provide a little help in terms of aesthetics and resource usage. https://github.com/cworld1/cworld1/blob/main/src/pages/rss.xml.ts Finally, thanks for clearing up the confusion! |
|
Awesome work @cworld1! It looks cleaner and more concise. Thanks for sharing your alteration. 😄 |
Description
When following the docs to add an RSS feed, I was left without any images. This PR adds some clarification around
allowedTagsand how to get images into your RSS feed.Related issues & labels
First-time contributor to Astro Docs?
First time contributor, and I am on the Discord as
tommypalmer🚀