-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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! |
@@ -183,7 +183,9 @@ export async function GET(context) { | |||
items: blog.map((post) => ({ | |||
link: `/blog/${post.slug}/`, | |||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and cross-checked with documentation for sanitize-html
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a great addition. Everything LGTM! Great work :) @tommyp !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: ![image](./test.jpg) 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
allowedTags
and 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
🚀