feat: Add json template

This commit is contained in:
Simon 2022-03-10 19:16:40 +01:00
parent c06ff39ffe
commit d5c0ebda14
4 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,3 @@
{
"data" : {{ block "response" .}}{{ end }}
}

View File

@ -0,0 +1,4 @@
{
"name": "{{ .Title }}",
"permalink" : "{{ .Permalink }}"
}

View File

@ -0,0 +1,7 @@
{{ define "response" }}
[
{{ range $index, $e := .Data.Pages }}
{{ if $index }}, {{ end }}{{ .Render "item" }}
{{ end }}
]
{{ end }}

View File

@ -0,0 +1 @@
{{ define "response" }} {{ .Render "item" }} {{ end }}