Just been thinking about something different, as with your approach causing me some hiccups.
By using sort I got this:
{{ range sort (where $allTools "identifier" "in" .) "identifier" }}
will sort alphabetically by identifier.
It would be nice if I could sort by $frontmatterIds
but somehow is not working.
Looking at this:
This shall theoretically work:
{{ range sort (where $allTools "identifier" "in" .) "Params.amazon"}}
but getting error calling sort: can't evaluate an invalid value
or
{{ range sort (where $allTools "identifier" "in" .) $frontmatterIds "asc" }}
no error, but not sorting correctly.