docs icon indicating copy to clipboard operation
docs copied to clipboard

Clarify how to add images to RSS

Open tommyp opened this issue 1 year ago • 4 comments

📚 Subject area/topic

RSS

📋 Page(s) affected (or suggested, for new content)

https://docs.astro.build/en/guides/rss/

📋 Description of content that is out-of-date or incorrect

Following the guide for adding an RSS feed, you'll be left with an RSS feed with no images.

Explaining how to add this with sanitize-html would be good.

I've forked and added this here, until I read that I should open an issue for something more than a typo.

Happy to open a PR with my fork too.

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

No response

tommyp avatar Feb 28 '24 22:02 tommyp

That's a great suggestion tommy 😄

at-the-vr avatar Feb 29 '24 07:02 at-the-vr

@at-the-vr Is it ok to open a PR for my fork?

tommyp avatar Feb 29 '24 12:02 tommyp

I gotta ask if you could wait for approval from maintainers 🙏

at-the-vr avatar Feb 29 '24 13:02 at-the-vr

Hi @tommyp , this looks like a great idea to add to the RSS content! Thank you for suggesting it!

Thank you for also waiting for the discussion here, and I do have thoughts...

Since we try to keep things concise and simple for everyone, what would you think about working this into the main example itself? So, no second code sample, but add everything required to the original code sample?

So, assume someone did want to include images. What all is required to add to that snippet, and what does the whole thing look like?

The line could be adjusted to something like:

When using content collections, render the post body using a standard Markdown parser like markdown-it and sanitize the result, including any extra tags (e.g. <img>) needed to render your content:

Would be happy to receive a PR along those lines, and we can work out the fine details in the PR itself! :raised_hands:

sarah11918 avatar Mar 04 '24 11:03 sarah11918

I am happy to take a look at implementing this. Since @tommyp already has a fork that does some of the work, if he gets a PR in will let him take it :)!

SatanshuMishra avatar Mar 22 '24 23:03 SatanshuMishra

@sarah11918 Thanks for the suggestion and the vote of confidence @SatanshuMishra! I've opened the PR. Glad I could make a contribution to such an awesome project.

tommyp avatar Mar 25 '24 21:03 tommyp