bridgetown
bridgetown copied to clipboard
feat: create Meta Collections merging multiple collections to render into timeline-like pages
Summary
This feature adds an option to configure a resource collection that includes multiple other collections, kind of like a timeline
concept. it can be used to easily create an overarching timeline page that includes multiple or all collections across the site's resources.
Motivation
I have a blog that includes two and more collections, currently the included posts
and custom collections links
and status_updates
. while i need the to behave like independent collections for most of the site's structure, i would like my main index page to be a timeline of all of these resources merged in chronological order.
Guide-level explanation
Meta-Collections
If you prefer to show multiple collections merged and ordered on a single page, you want to use a meta-collection. These are configured principally like collections, but have an additional list of actually existing collections:
# bridgetown.config.yml
meta_collections:
<name>:
output: true
permalink: pretty
future: true
includes:
- coll_1
- coll_2
The list of names needs to be identical, misspelled items will raise an error.
Reference-level explanation
Drawbacks
Unresolved Questions
Some related issues might be:
https://github.com/bridgetownrb/bridgetown-feed/issues/10 https://github.com/bridgetownrb/bridgetown/issues/384
I'm doing some issue gardening 🌱🌿 🌷 and came upon this issue.
Seems like something you'd just write in your own app, with ruby code (we've done something similar). In my opinion, it doesn't make sense to have this in Bridgetown core.
I'd vote for closing this issue.
By closing some old issues we reduce the list of open issues to a more manageable set.
For something like pagination/prototype pages, we can probably just add support for filtering on multiple collections via an array. Maybe allow specifying overall sort order. That seems like a much simpler option.
Some talk's come up around relations needing to "merge" multiple collections for the sake of the relationship, so it's possible we'd need a more general "virtual collection" after all.