Example
This commit is contained in:
commit
05d04912ed
10
data.json
Normal file
10
data.json
Normal 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
10
template.html
Normal 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 }}
|
Loading…
Reference in New Issue
Block a user