Filter/group posts by year

I voluntarily work on a Ghost website of an author and columnist (who recently passed away), which has around 4,000 posts with 30+ years history. Readers often want to check his articles on specific dates (years/month). And this need brings me to the same point again, about how to make a chronological archive or index page in Ghost.

I checked the forum once again to see if we have something that I missed, but unfortunately couldn’t find any relevant solution. The most popular and suggested solution relies on listing “all” articles in a page, and show them under Year/Month titles with some CSS trick. But I think it would be not nice to fetch 4k rows from db, show all post links in a single HTML.

As far as I can see, we also don’t have any query options on API to list “years” of posts, so we can show a year list, then -maybe- filter posts by years.

I’m now in a decision point to choose a path for a solution. The options that I see:

  • Implement an external search, which can filter by years, or even list years/months as filtering points. So a solution completely outside of Ghost.
  • Create static pages (with collections) for each year, then make another static index page to link them.
  • Check deeper on Ghost routing/templating dynamics to try adding date-releated contexts to them, so we can have dynamic data, like {{# get "years" ... }} (which would return the years of active posts with optionally given filters), or filtering with group_by, or having {{ year }} parameter as path param in route definitions, etc.

I would like to select the last option, as it would help every single Ghost user (and also template developers) who will need making this type of pages, but I have 2 concerns:

  1. This may require an extensive work and I don’t even know if Ghost team would like to merge a feature like this.
  2. I don’t know the demand of a feature like this. I see handful of posts in this forum about this need, but some are happy with a static page, or some fccus on other things.

So, I would like to ask here for the opinions. Do you think some helpers, built-in solutions in Ghost for a chronological index page is a real need? Or do you think this is too niche, or too advanced for most of the Ghost publishers, so solving outside of the Ghost fits better? Or do you already have a practical solution for that use case?

Thanks in advance for your opinions. (Also for your patience and time to read this long post :blush:)

1 Like

chronological archives are such a basic feature on other platforms that the lack of it in ghost always felt like a blind spot to me
just wanted to say I really appreciate you dedicating your time to this

1 Like

It would be really nice to have routing that would accommodate an archive, like

mysite.tld/possible-subdirectory
mysite.tld/possible-subdirectory/date/2025
mysite.tld/possible-subdirectory/date-2025-04

So sort of similar to the pagination helper – it’d find the requested slice of the overall collection and give you that.

1 Like

I’m actually very familiar with urls like below from Wordpress times:

some.blog/2026/02/post-slug/ => article
some.blog/2026/02/ => post list of Feb 2026
some.blog/2026/ => post list of 2026

I would really like to achieve same type of urls in my website. First one is already possible. I think we need something extra like:

collections:
  /{year}/{month}/: 
    template: index
    permalink: /{year}/{month}/{slug}/
  /{year}/:
    template: index
    permalink: /{year}/{month}/{slug}/

So, year and month as both filter and context parameter.

They’d have to be channels, right? Because a post can only be in one collection.

I’d rather have an explicit filter than it being magic, since I might in fact have two archives I want to group by year/month… :) So more like filter:tag:mytag+published_at:year

1 Like

Or actually, maybe more like the behavior of /page/x, where I don’t have to do anything with yaml and it just works… :)

We’re currently working on a newsletter archive and the requirements are pretty similar. Would be great if there was some sort of native support.
So for listing years and months and posts under them, I’m planning to use static stuff and a year filtered page using published_at (range). But there’s no dynamic rendering at least for now, except that I might do a custom helper for some of this (if possible).