How to range over getJSON dynamic content

I have some JSON data:

I have some shortcode here:

<h1>Coupons</h1>
{{ $json := getJSON "https://news.marijuanadaily.net/output.json" }}

{{range $json}}

{{ $c := . }}

{{$c.logo}}

{{end}}

I am not sure how to access the items in my json file. Documentation exmaples are unclear.

EDIT: Oh, silly me, I just realized it’s nested.

{{ $json := getJSON "https://news.marijuanadaily.net/output.json" }}

{{range $json}}

    {{ $c := . }}

    {{range $c}}
        {{ $d := .}}
        {{ $d.logo }}
    {{end}}

{{end}}
1 Like

Just wanted to mention, instead of trying to range over something nested, I fixed the problem at the source of the json feed generation.

However, scheduling a build every few hours for hugo, so that the latest data can be generated, was not feasible for many reasons.

So currently having to resort to ajax stuffs.

I wonder the possible application for this. It seems build scripts must be scheduled without which it’s still static, not dymanic in any manner.

Why is scheduling problematic?

In my particular use case, the data would be generated based on geolocation. It’s no shortcoming of Hugo, I’m just pondering the possible applications of this in whatever psuedo-dynamic manner.