Set date of list page as the date of its most recent subpage

Hi all, looking for a little help here.

I have a blog, which in turn has both individual posts, and “series” posts which actually contain multiple subposts, or “chapters” if you will. In my content folder, that structure looks like:

- /post-1
- /post-2
- - /chapter-1
- - /chapter-2
- /post-2

Sometimes, I publish a new chapter to a post from awhile back, and I’d like for the main post to inherit the date of the most recent chapter, so it gets pushed back to the top of my blog. Anyone have an easy way to do this without manually adjusting the date?

If it was a leaf bundle with the post having an and the chapters in files like etc, you could use something like first .Pages.GroupBy.Reverse “Date” and use that pages date.