eleventy
eleventy copied to clipboard
One to one link between posts in different categories - elegant way?
Hi! This is possibly more of a Nunjucks question than 11ty, but I'm hoping there's a smooth way of doing it:
I am creating a site with three categories (Sources, Concepts, References), which all link to each other. For example, a reference might be tagged with several concepts. This is fine - I used an example from the basic blog repo to get everything in the concept collection and iterate over it, looking for ones tagged with a matching concept.
However, a reference will only ever have one source. It feels inefficient to grab everything in the source collection and iterate over all of it, looking for the one match to the "source" setting in the reference frontmatter.
Can anyone point me to a better way?
Repo here: https://github.com/StarfallProjects/habermas-concepts