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/.