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

Sorted the rss feed from latest to oldest. #38

Merged
merged 4 commits into from
Mar 17, 2023
Merged

Conversation

saif71
Copy link
Contributor

@saif71 saif71 commented Feb 22, 2023

Sorted the rss feed from latest to oldest. Which is crucial for RSS readers.

Sorted the rss feed from latest to oldest. Which is crucial for RSS readers.
Copy link
Owner

@satnaing satnaing left a 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 }) => ({
    // ---
      })),
  });
}

@saif71
Copy link
Contributor Author

saif71 commented Feb 27, 2023

ah right. I forgot about the util func.. @satnaing

Copy link
Contributor Author

@saif71 saif71 left a 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

@satnaing
Copy link
Owner

satnaing commented Mar 1, 2023

So, would you like to update the requested changes?
Or would you like to close the PR? @saif71

@saif71
Copy link
Contributor Author

saif71 commented Mar 1, 2023

@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 :(

@satnaing
Copy link
Owner

satnaing commented Mar 1, 2023

Ok Ok, got it!

@satnaing
Copy link
Owner

Hello @saif71,
I noticed that it's been a few weeks since the requested changes. I understand that you may be busy with other tasks, but I was wondering if there's anything I can do to help move this forward. If so, plz let me know. ✌🏻
Appreciate your efforts and look forward to your response.

@saif71
Copy link
Contributor Author

saif71 commented Mar 17, 2023

@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.

@satnaing
Copy link
Owner

I made tiny updates in PR. But overall, LGTM now.
Thanks!

@satnaing satnaing merged commit 9e62b63 into satnaing:main Mar 17, 2023
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

Successfully merging this pull request may close these issues.

2 participants