{{ $len := (len $.Site.Data.memberships.membership_levels) }}
{"memberships": [
    {{- with $.Site.Data.memberships.membership_levels }}
    {{- range $index, $element := . -}}
    { "name": "{{ .name }}", "value": {{ .value }}, "currency": "{{ .currency }}", "billing_interval": "{{ default "monthly" .billing_interval }}", "link": "{{ .link }}", "description": "{{ .description}}"}{{ if ne (add $index 1) $len }},{{ end }}
    {{- end }}
    {{- end }}]}
