From 1a8a3d070972de200d7307cbb02dd4b35418cb2f Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Mon, 1 Nov 2021 12:08:07 +0100 Subject: [PATCH] Add index templates --- themes/custom/layouts/index.html | 3 +++ themes/custom/layouts/index.json | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 themes/custom/layouts/index.html create mode 100644 themes/custom/layouts/index.json diff --git a/themes/custom/layouts/index.html b/themes/custom/layouts/index.html new file mode 100644 index 0000000..f752ee3 --- /dev/null +++ b/themes/custom/layouts/index.html @@ -0,0 +1,3 @@ +{{ define "main" }} +{{ .Content }} +{{ end }} \ No newline at end of file diff --git a/themes/custom/layouts/index.json b/themes/custom/layouts/index.json new file mode 100644 index 0000000..367f3b3 --- /dev/null +++ b/themes/custom/layouts/index.json @@ -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 -}}] \ No newline at end of file