Skip to content
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

RSS post content #73

Closed
fi0 opened this issue Dec 23, 2022 · 1 comment
Closed

RSS post content #73

fi0 opened this issue Dec 23, 2022 · 1 comment

Comments

@fi0
Copy link

fi0 commented Dec 23, 2022

https://docs.astro.build/en/guides/rss/#including-full-post-content
I tried to use post.Content but it didn't work. How should I include the full post in the RSS feed?

@prototypa
Copy link
Contributor

Hello @fi0

Thank you for contacting. This is not a bug in the template. This is the way it is expected to work, and it is not recommended to include <content> in the RSS, partly because the content field is not recognized by the rss feed specification.

In any case, if you want to carry it out, before, take into account the following: according to the link you share, it specifies that you can use post.compiledContent() only if markdown is included, not for MDX.

However, if you create the list of RSS feed objects yourself, you can pass the content of Markdown files (not MDX), to the content key using the compiledContent() property.

If in the use that you are giving to the template you only include markdown (.md) then you can do the following:

  1. Go to this file https://github.com/onwidget/astrowind/blob/main/src/utils/posts.js#L1 and add in the getNormalizedPost method the return of the compiledContent property (in case it is available, only for markdown)
  2. In the https://github.com/onwidget/astrowind/blob/main/src/pages/rss.xml.js file do something similar to what is specified in the link you shared:
content: sanitizeHtml(post.compiledContent())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants