HomePhabricator

[e.cash] Sort blogs by publish date

Description

[e.cash] Sort blogs by publish date

Summary:
It was requested to have the ability to back date blog posts. Currently they are grabbed from strapi
and returned in order by the publishedAt field.

This field is generated by strapi based on when the post was published and afaik theres not an easy way to edit it after the fact

So if we want to say copy and older post from somewhere else, its publish date will be the day its copied and published,
and it will appear later than its actual publish date.

I actually already setup an alternative date field for this reason when migrating the blog. All of the legacy posts needed
to maintain their original publish dates so I added the publish_date field that can be added by any author. This takes
precedent over the publishedAt field. So all legacy posts actually have the same day publishedAt value, each one is just a few seconds
older than the next as they were uploaded.

Long way to explain, Im adding a sort function to the blog getter based on either publishedAt or publish_date. This way we
can manually input an older publish_date for a given post in the strapi UI and it should appear in the correct place

Test Plan:
preview the site and check /blog. Scroll down to July 2023 posts and you should see the back dated 'How to Run CashFusion Remotely' in the
proper place

Then if you preview master it would appear at the top

tests should still pass as well

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D15005

Details

Provenance
johnkuneyAuthored on Dec 20 2023, 07:06
johnkuneyPushed on Dec 20 2023, 07:07
Reviewer
Restricted Project
Differential Revision
D15005: [e.cash] Sort blogs by publish date
Parents
rABC9877fd6af1b2: [Chronik] Add `should_ignore` to `empp::ParseError`
Branches
Unknown
Tags
Unknown