Skip to content

Feed Plugin Sorting #3487

Answered by fdevans
fdevans asked this question in Q&A
Oct 4, 2023 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

OK ... I fixed this with the fixed from version 238 mentioned above.

The sort entry needs to be called sorter and now the following entry properly sorts on frontmatter.date (docs are wrong, I'll try to send a PR):

      feed: {
        hostname: 'https://yourhost.com',
        rss: true,
        json: true,
        filter: ({ frontmatter, filePathRelative }: Page): boolean => !(frontmatter.feed === undefined || frontmatter.home || !filePathRelative || frontmatter.article === false || frontmatter.feed === false),
        sorter: (
          pageA: Page,
          pageB: Page,
        ): number =>
          compareDate( pageA.frontmatter.date, pageB.frontmatter.date)
      }

Also important…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Mister-Hope
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@fdevans
Comment options

@fdevans
Comment options

Answer selected by fdevans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants