bridgetown icon indicating copy to clipboard operation
bridgetown copied to clipboard

feat: create Meta Collections merging multiple collections to render into timeline-like pages

Open whysthatso opened this issue 1 year ago • 3 comments

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

whysthatso avatar Mar 15 '23 12:03 whysthatso

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.

sandstrom avatar Jun 22 '23 11:06 sandstrom

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.

jaredcwhite avatar Jun 27 '23 15:06 jaredcwhite

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.

jaredcwhite avatar Aug 02 '23 21:08 jaredcwhite