I have data/allies/count.yml:
- people: "46"
organizations: "6"
Which I successfully extract to JSON with
{
"people": "{{ index .Site.Data.allies.count 0 "people" }}",
"organizations": "{{ index .Site.Data.allies.count 0 "organizations" }}"
}
or
{
{{ range .Site.Data.allies.count }}
"people": "{{ .people }}",
{{ end }}
{{ range .Site.Data.allies.count }}
"organizations": "{{ .organizations }}"
{{ end }}
}
My questions are:
- Can I get rid of the "
-" indata/allies/count.yml*? Then how must I adapt theindexorrangecalls to acomodate the absence of "-"? - Can I simplify the
indexorrangecalls, am I doing it the right way?
*I’d rather have:
people: "46"
organizations: "6"
So simple…