Gatsby: Filter posts in www by date

Created on 22 Oct 2018  路  4Comments  路  Source: gatsbyjs/gatsby

Currently all blog posts on www are displayed. As a result, when we calendar posts for the future, sometimes we need to hold merging them until the future, and then we forget....

In order to avoid this problem, we want to be able to merge posts right away, but have them not show up in lists until they are published.

As a result:

  • Blog posts should continue to page be created as pages, no matter if in the past or future...
  • ...but they should only show up in the home page, /blog page, and /tag pages if the date is not in the future.
  • Filtering should be server-side (probably can't be client-side due to pagination unfortunately) and future should be calculated as GMT future (to be friendly to European audience).
Hacktoberfest good first issue

Most helpful comment

I'd like to work on this :)

All 4 comments

I'd like to work on this :)

@jgierer12 we would love if you do :) Thank you!

One thing I noticed is that, if this were to be implemented server-side, we'd have to make sure the site is rebuilt once the article should be listed. Does this happen often enough anyways (at least once per day)? Or is there some way to programatically force a rebuild? Otherwise I think we'd have to find a client-side solution.

Yeah, for many sites this might be a problem but gatsbyjs.org is rebuilt probably 10-15 times a day (or more. Just counted and it's been built 13 times in the last 13 hours so once an hour on average).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

brandonmp picture brandonmp  路  3Comments

jimfilippou picture jimfilippou  路  3Comments

signalwerk picture signalwerk  路  3Comments

KyleAMathews picture KyleAMathews  路  3Comments