My current workaround to use .Resources.Match within a partial and getting more specific data for this specific part of the page.
The content structure using page bundles:
content/index/index.md <- page data
content/index/some-partial.md <- partial data
content/index/some-partial/more-data.md <- more specific partial data, which needs to be loopable
Thanks for the range sort tip. Was some leftover code from another workaround.
Unfortunately using the context “.” doesn’t work as then one can’t access .Resources.Match within the partial. This is essential to access the sub page bundles.
In that case, you can “pass multiple contexts” to the partial… as a slice. Pass the whole .Resources as well as the current slice element of .Resources as a 2-element slice to the Partial.
I’d be surprised if that would work. I think you will need to assign the whole .Resources to a var outside the range, and then pass that var as value to the “resources” dict key.
So the idea is to have a content structure such as:
content/index/index.md <- main page data
content/index/team.md <- team partial
content/index/team/gopher-1.md <- team member specific data
content/index/team/gopher-2.md
content/index/team/tiny-gopher.jpg <- media name specified in gopher-1.md