I have a frontmatter param that is an object list (below). How can I use where
with an optional field of that list?
title: A title
events:
- type: inSite
reference: /events/an-event-in-this-site # <-- this optional field
- type: external
title: An external event
- ...
In this example, the field in question is events.reference
. I’d like to write something like
$events := where site.RegularPages "Params.events.reference" .Path
But that doesn’t work… What I currently do, which is not very elegant, is range all pages and in each page range all Params.events
, testing that reference
field.
Is it possible to do it?