-
-
Notifications
You must be signed in to change notification settings - Fork 517
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
Sorted the rss feed from latest to oldest. #38
Conversation
Sorted the rss feed from latest to oldest. Which is crucial for RSS readers.
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.
Thanks for pointing this out.
Appreciate your work. But, AstroPaper already has a util function called getSortedPosts
for sorting blog posts. This util func automatically filters out the draft posts and sort according to pubDatetime
.
It'd be solved you change something like this
const posts = await getCollection("blog");
const sortedPosts = getSortedPosts(posts);
return rss({
// ---
items: sortedPosts.map(({ data }) => ({
// ---
})),
});
}
ah right. I forgot about the util func.. @satnaing |
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.
ya i think this works
So, would you like to update the requested changes? |
@satnaing No no. I don't want to close. I will update the request. I'm just not getting enough time this week to do so.. Sorry :( |
Ok Ok, got it! |
Hello @saif71, |
@satnaing really sorry for the delay. I've pushed another commit. This time using the util func as you requested. Hope you will be able to merge it now.. Thanks. |
I made tiny updates in PR. But overall, LGTM now. |
Sorted the rss feed from latest to oldest. Which is crucial for RSS readers.