feat: implement hack for journal post RSS feed

Astro is currently not able to render the compiled HTML of MDX files to a string.
This makes it impossible to render the content for an RSS feed.

Issue: Container API: render components in isolation
https://github.com/withastro/roadmap/issues/533

Proposal: MDX compiledContent() support
https://github.com/withastro/roadmap/discussions/419

To still be able to have full content for RSS feeds, this dirty hack,
Scott Willsey writes about in his 2-part blog post is needed:

https://scottwillsey.com/rss-pt1/
https://scottwillsey.com/rss-pt2/
This commit is contained in:
Stefan Imhoff
2023-06-13 18:52:13 +02:00
parent aa4b69f29c
commit f3986f9d6c
5 changed files with 74 additions and 1 deletions

View File

@@ -1,3 +1,7 @@
export const sortByDate = (a: any, b: any) => {
return Date.parse(b.data.date.toISOString()) - Date.parse(a.data.date.toISOString());
};
export const sortMarkdownByDate = (a: any, b: any) => {
return Date.parse(b.frontmatter.date) - Date.parse(a.frontmatter.date);
};