This commit is contained in:
Stefan Ritter 2023-04-01 09:22:13 +02:00
commit 05d04912ed
2 changed files with 20 additions and 0 deletions

10
data.json Normal file
View File

@ -0,0 +1,10 @@
{
"01 Foo": {
"01 Egg": "http://egg",
"02 Ham": "http://ham"
},
"02 Bar": {
"01 Spam": "http://spam",
"02 Drum": "http://drum"
}
}

10
template.html Normal file
View File

@ -0,0 +1,10 @@
{{ range $section, $content := .Site.Data.data }}
{{ $title := substr $section 3 }}
<span class="title">{{ $title }}</span>
<ul>
{{ range $link_name, $link_href := $content -}}
{{ $link_name := substr $link_name 3 -}}
<li><a href="{{ $link_href }}">{{ $link_name }}</a></li>
{{ end }}
</ul>
{{ end }}