webmasterish / vuepress-plugin-feed

RSS, Atom, and JSON feeds generator plugin for VuePress 1.x
MIT License
48 stars 13 forks source link

add a sorting option #4

Closed yanick closed 5 years ago

yanick commented 5 years ago

Add a sort option to sort the entries

Description

Right now there is no sorting done on the feed entries. For feeds that have more entries than the count option allows, one might want to get the latest entries, or the most popular, etc. Hence the need to be able to sort the entries.

webmasterish commented 5 years ago

Definitely!

One minor thing that has to do with my unjustifiable OCD; please use hard tabs of 2 spaces in the following:

https://github.com/webmasterish/vuepress-plugin-feed/blob/63c3302d80b0d486abc333dc71ea3e372a160119/index.js#L229-L233

https://github.com/webmasterish/vuepress-plugin-feed/blob/63c3302d80b0d486abc333dc71ea3e372a160119/lib/Generator.js#L88

Thanks @yanick!

yanick commented 5 years ago

please use hard tabs of 2 spaces in the following

Barbarian. ;-) But your house, your rules. Spaces are tabified.

And I didn't know if you wanted to make sorting by reverse date the default. On one hand, it makes sense, on the other, it's a change in default behavior. So I kept the PR minimal, leaving you with the liberty to do what you'd prefer.

Enjoy! :-)

webmasterish commented 5 years ago

Barbarian. ;-) But your house, your rules. Spaces are tabified

Tell me about it! I have to live with that!

I like it minimal just the way you did it, this way it defaults to however the pages are passed in extendPageData, which currently, if I'm not mistaken, default to descending by date.

Thanks again @yanick!

yanick commented 5 years ago

I like it minimal just the way you did it, this way it defaults to however the pages are passed in extendPageData, which currently, if I'm not mistaken, default to descending by date.

Either desc by date or random. I just saw that it didn't do exactly what I did, so I dove in. ^.^

Thanks for the quick response, and thanks for an awesome plugin. This makes feed generation as painless as it can be, which is :100:.

webmasterish commented 5 years ago

Thanks you @yanick! You made my day!