As far as I know, markdown file is not supported in data directory.
But as long as json files are used, it should be ok.
I created a demo for you.
See this template.
The thing to understand here is, that data/foldername/filename.toml translates to site.Data.foldername.filename. So you can’t just range over site.Data
With this structure:
data/
verbs/
form_1/
form_2/
...
I would range over the folders like this:
{{ $key, $value := range site.Data.verbs.form_1 }}
{{ $key }} <-- data (from data.toml)
{{ $key2, $value2 := range $value.data }}
{{ $value2 }} <-- everything in data.toml
{{ end }}
{{ end }}
For your sample json file you would have (inside the ranges above):
{{ $key }} <-- "form_1"
then range through `$value.data`:
{{ $key2 }} <-- "2:143"
then range through value2:
{{ $value2.arabic }} <-- sorry, can't select a short sample, but it's the content of the arabic part.
{{ $value2.buckwalter }} <-- wa ka *a`lika jaEalo na` kumo ...
{{ $value2.translation }} <-- And thus we have made you a just community
Remember, that it would be much better to have a minimum workable example. just some layout files with one or two datafiles so someone could present proper code samples.
That’s what I mean with “let us have a sample”. At least put a sample site with that theme and your data directory into a github repo. What you are trying to do right now is hinting about your real setup … for instance:
what page is rendering the verbs/index.html layout? (Pretty sure that layout file is never used, because it indicates a section verbs which would require a list.html and a single.html.
how does the “inside” of verb_1 look like?
I am relatively sure your attempts might be working, but not with the content/layout setup you have.
Sorry, I made a mistake about the files I meant to say single.html instead of index.html. I will try to setup the git repo, but for now here is the output of layouts/verbs/single.html:
{{ define "main" }}
{{ range $parentKey, $parent := .Site.Data.verbs }}
<p> {{ $parentKey }} <p> <-- shows form_1 and on next loop, shows form_2
{{ range $childKey, $child := $parent }}
<p> {{ $child }} </p> <-- shows the first entry of form_1: entry_1 & form_2: entry_2
<h3> Ref: </h3>
<p> {{ .title }} </p>
<h3> Content: </h3>
<p>{{ $child.arabic | safeHTML}}</p> <--shows nothing
<!-- [aya][translation] -->
<p>{{ .translation | safeHTML}}</p> <--shows nothing
<hr>
{{ end }}
{{ end }}
{{ end }}
and my layouts/verbs/list.html:
{{ define "main" }}
<ul>
{{ range .Data.Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>
{{ end }}
Here is the sample of content/verbs/form_1/entry_1.md:
---
title: "entry_1"
---
and in content/verbs/_index.md the content to cascade the MD files: