From the looks of it, I cannot run something like: {{ range where $.Site.data.events "status" "past" }} since {{ range $.Site.data.events }} is actually a map type (map[filename][content]).
The only way I see to do what I want right now is to actually merge all these data files into one event.yml that contain an array instead of a dict.
@tatsushid would know, but I assume currently not possible. But it would be fairly easy to extend the where func with map support if we could agree on what to do about the sorting (as is (fairly random) or sort by key?)
Yea, I think going by key is the usual convention (since value can be complex data type).
Python:
In [2]: x = [1,2,3]
In [3]: 1 in x
Out[3]: True
In [4]: y = {1:2,3:4}
In [5]: 1 in y
Out[5]: True
(in in Hugo doesn’t work with maps as well at the moment).
Generally, I got the feeling that Hugo right now plays much better with arrays than maps. Maybe there’s a way to convert map into two different arrays? (first array is the keys, second is the values)
Thanks for your help.
p.s
I just realized that if where were implemented to look by key in maps that doesn’t really help my case. But maybe other ideas might follow.