# Group by date

**URL:** <https://zola.discourse.group/t/group-by-date/2498>\
**Category:** Feature requests\
**Created:** [March 2, 2025, 4:26pm UTC](https://zola.discourse.group/t/group-by-date/2498 "2025-03-02T16:26:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![seam345](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@seam345](https://zola.discourse.group/u/seam345)\
**Post date:** [March 2, 2025, 4:26pm UTC](https://zola.discourse.group/t/group-by-date/2498/1 "2025-03-02T16:26:38Z")

</div>

# Feature Request - Group by date

Would be great to be able to group posts by date similar to Ikiwikis calendar plugin ikiwiki.info/plugins/calendar/

## Example

Say I have 4 posts with publications date as follows

1. 2025 Dec 1st
2. 2025 Oct 5th
3. 2025 Jan 15th
4. 2025 Jan 1st

Group by date would generate 3 Groups

1. Would contain 1 Dec post with URL `<base_url>/blog/2025-12/`
2. Would contain 1 Oct post with URL `<base_url>/blog/2025-10/` (Note the skipping of empty months e.g. 2025-11)
3. Would contain 2 Jan posts with URL `<base_url>/blog/2025-01/`

Paired with the right template we could have a list on one side for the selected month and a graphical pagination like

 ![image](https://global.discourse-cdn.com/free1/uploads/zola1/original/2X/3/3740163db312eeff26dda6178d119f973bb77f24.png)

## Use cases

- Events like rustmanchester .co.uk/events/ would be a lot nicer to show by month
- Archives [Group by year/time order](https://zola.discourse.group/t/group-by-year-time-order/192)

## POC

I built out an initial POC on my fork [feat(date\_pagin): date pagination · seam345/zola@d218acf · GitHub](https://github.com/seam345/zola/commit/d218acf3e5cabb841be415cb86e211867b9fd6bb)

This worked by adding another Paginator and adding options to the paginate\_by config. There is still a lot to do but works as a POC.

### Config change

For POC I just got something that worked but it would break backwards compatibility so we need a nicer way to choose between date pagination and normal pagination (I am assuming we have no use cases where generating both index and date pagination exists)

`paginate_by = { num = 10 }` is the current old method equivalent to `paginate_by = 10 `

`paginate_by = date` will paginate pages by month published.

### Templates and URL Scheme

I changed the URL scheme for dates from 1/2/3 to YYYY-MM e.g `2024-11` Next and previous page kinda works out the box but any template that jumps to a specific pager breaks as they assume index so this completely breaks

### Other things missing in POC

- Sitemap doesn’t have any of the paginated pages at the moment
- Date pagination doesn’t exist for Taxonomy
- I don’t confirm the sorting is by date atm which can lead to a lot of undefined behavior

# Questions

- Before I continue working on it, is this something other people would like?
- Am I missing any other use cases?
  - e.g. is there a use case where a section would be paginated traditionally and by date

- At the moment I made it only paginate by month but would it be better to have a year then month pagination?

---

<div class="post-metadata">

**Author:** ![seam345](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@seam345](https://zola.discourse.group/u/seam345)\
**Post date:** [March 2, 2025, 4:28pm UTC](https://zola.discourse.group/t/group-by-date/2498/2 "2025-03-02T16:28:34Z")

</div>

New users can only make 2 links so i broke the ikiwiki calendar link and the rust Manchester one,  
here they both are for convenience

- [calendar](https://ikiwiki.info/plugins/calendar/)
- [Rust Manchester | Fast, Lightweight, and Modern Zola Theme](https://rustmanchester.co.uk/events/)
