Escaping symbol in JSON Data object

I have a file called ga.json in my data folder. This file is automatically created from a script and made available to Hugo. However, this JSON file has keys that uses colons in their naming. When accessing the data through Hugo that does not work. How can I escape the colons when getting this data in Hugo?

Code to get the data:
{{with $.Site.Data.ga}}
{{ .ga:sessions }}
{{end}}

ga.json
{"ga:pageviews":"416","ga:sessions":"57"}

use index function.

{{with .Site.Data.ga}}
{{ index . "ga:sessions" }}
{{end}}
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.