Current examples are like this:
{{/* Get remote data. */}}
{{ $data := dict }}
{{ $path := "data/verses/reality01.json" }}
{{ with resources.Get $path }}
{{ with . | transform.Unmarshal }}
{{ $data = . }}
{{ end }}
{{ else }}
{{ errorf "Unable to get global resource %q" $path }}
{{ end }}
You have to hardcode the file itself. Is there a way for it to process all files inside a directory the way .Site.Data works?
Iβm looking for something like this, so itβs easier to manage once the db gets bigger:
/assets/
βββ /data/
β βββ /chars/
β β βββ angelica.json
β β βββ thomas.json
β βββ /items/
β βββ dragonlance.json
β βββ bag-of-holding.json
βββ /some-other-assets/
Thank you!
PS
- sample site: kolverse/site.kwwp: Website for the Kolverse Worldbuilding and Writing Project. - Codeberg.org (has other mounts in it that I havenβt removed yet)
- The
/data/( kolverse/kwwp-database: Kolverse Worldbuilding and Writing Project database. - Codeberg.org ) is mounted in/assets/.