Add index templates

This commit is contained in:
Alexandre Iooss 2021-11-01 12:08:07 +01:00
parent 6f3d809d02
commit 1a8a3d0709
2 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,3 @@
{{ define "main" }}
{{ .Content }}
{{ end }}

View file

@ -0,0 +1,12 @@
[{{ range $index, $page := .Site.Pages }}
{{- if ne $page.Type "json" -}}
{{- if and $index (gt $index 0) -}},{{- end }}
{
"uri": "{{ $page.Permalink }}",
"title": "{{ htmlEscape $page.Title}}",
"tags": [{{ range $tindex, $tag := $page.Params.tags }}{{ if $tindex }}, {{ end }}"{{ $tag| htmlEscape }}"{{ end }}],
"description": "{{ htmlEscape .Description}}",
"content": {{$page.Plain | jsonify}}
}
{{- end -}}
{{- end -}}]