goldsmith/plugins/collection/testdata/source/template.gohtml
2024-02-16 22:35:49 -08:00

34 lines
541 B
Plaintext

{{define "page"}}
<html>
<body>
<h1>{{.Props.Title}}</h1>
</body>
</html>
{{end}}
{{define "collection"}}
<ul>
{{range .}}
<li>
<a href="{{.Path}}">{{.Props.Title}}</a>
</li>
{{end}}
</ul>
{{end}}
{{define "index"}}
<html>
<body>
<div>
<h1>Group 1</h1>
{{template "collection" .Props.Groups.group_1}}
</div>
<div>
<h1>Group 2</h1>
{{template "collection" .Props.Groups.group_2}}
</div>
</body>
</html>
{{end}}