Range index, value where?

I’m trying to do the following :

{{ range  $key, $value := (where $.Site.Data.downloads "type" "==" "release") }}

Currently, I have the following code that works :

<h2>Beta versions</h2>
{{ range $key, $value := $.Site.Data.downloads }}
{{ if eq $value.type "beta" }}
<h3>{{ $key }}</h3>
OVA : <a href="https://xxx.xxx.xxx/dl/{{ $value.OVA }}">{{ $value.OVA }}</a> (md5 <code>{{ $value.MD5 }}</code>)<br>
Update : <a href="https://xxx.xxx.xxx/dl/{{ $value.UPDATE }}">{{ $value.UPDATE }}</a>
{{ end }}
{{ end }}

But it’s limited in the way that when there is no beta version, I am displaying the title anyway.

So I was trying to clean the code a bit and start with looping over the filtered list as the documentation seems to indicate it’s possible. The JSON is like the following :


Ideally, I would like to display a beta download section only if there is anything type=“beta”, same for the stable release.