From 99a4b9f4d97594a5962772a168f003ea9211912e Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 16 Sep 2017 23:13:02 +0100 Subject: [PATCH] Add page list json file --- config.yml | 1 + layouts/_default/list.json | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 layouts/_default/list.json diff --git a/config.yml b/config.yml index 546a8bd..6ca5b34 100644 --- a/config.yml +++ b/config.yml @@ -19,6 +19,7 @@ outputs: home: - "html" - "rss" + - "json" section: - "html" - "rss" diff --git a/layouts/_default/list.json b/layouts/_default/list.json new file mode 100644 index 0000000..1388ca8 --- /dev/null +++ b/layouts/_default/list.json @@ -0,0 +1,14 @@ +{ + {{ range $i, $e := .Data.Pages.ByTitle }} + {{ if $i }}, {{ end }} + "{{ .RelPermalink }}": { + "id": "{{ .UniqueID }}", + "title": "{{ lower .Title }}", + "date": "{{ .Date }}", + "url": "{{ .Permalink }}", + "link": "{{ .RelPermalink }}", + "link_title": "{{ .LinkTitle }}" + "parent": "{{ if .Parent }}{{ lower .Parent.Title }}{{ end }}" + } + {{ end }} +}