goldsmith/plugins/collection/testdata/source/template.gohtml

34 lines
541 B
Plaintext
Raw Permalink Normal View History

2024-02-17 06:35:49 +00:00
{{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}}