I would be grateful if anybody could point me towards a theme which includes an archive of posts organized chronologically … (posts from 2021, 2020, 2019, 2018, … ).
Here is an example of what I mean …
Archives - Lorcan Dempsey’s Weblog (oclc.org)
Update: I see that this has been discussed and addressed before here.
Hi. I’m relatively new to Ghost—I’m working on my second site with it, and my second custom theme—and I’ve run into a dead end. (I’m prototyping the site on Glitch using Ghost 3.0.0)
I want to have an archive index page with no individual entries, but rather a list of months/years, i.e. “January 2020”. Following a month link would then bring you to a page containing all the posts for that month.
I’m having trouble figuring out how to do either of these things. There doesn’t seem to be a way to…
Although what is proposed still lists all the entries, rather than just a series of links to years or months.
1 Like
I am thinking of something like this …
Archives - Lorcan Dempsey’s Weblog (oclc.org)
The reason for wondering about a theme is to see how people approached it.
Not currently at a knowledge level that would mean I could easily figure it out from scratch. Thanks.
I don’t think there’s an easy way to do this with Ghost. There’s some newer discussion with some example SQL to get a list of months or years that contain posts and the count for each month. What’s missing is connecting the result that query with the frontend templates:
The solution by @denvergeeks would work, but involves selecting the details of every post from the database, sending a lot of data to the frontend that will be discarded, and then having the browser process every post to come up with the result. Here’s example of what it looks like to query this data directly using SQL. I’ve provided an example of querying the by-month counts and also by-year counts. You can see the report that both queries take “0.00” seconds for a small dataset, and this woul…