diff --git a/layouts/_default/list.json b/layouts/_default/list.json index 3b4bc06..30ef6f5 100644 --- a/layouts/_default/list.json +++ b/layouts/_default/list.json @@ -1,6 +1,6 @@ { {{ range $i, $e := .Data.Pages.ByTitle }} {{ if $i }}, {{ end }} - {{ partial "page_data.json" . }} + "{{ .RelPermalink }}": {{ partial "page_data.json" . }} {{ end }} } diff --git a/layouts/_default/single.json b/layouts/_default/single.json index e34c37a..2f4a87c 100644 --- a/layouts/_default/single.json +++ b/layouts/_default/single.json @@ -1,12 +1 @@ -{ - "id": "{{ .UniqueID }}", - "title": "{{ .Title }}", - "date_published": "{{ .Date }}", - "image": "{{ absURL .Params.image }}", - "url": "{{ .Permalink }}", - "content_html": {{ jsonify .Content }}, - "content_text": {{ jsonify .RawContent }}, - "summary": {{ jsonify .Summary }}, - "banner_image": "{{ absURL .Params.image }}", - "tags": {{ jsonify .Params.tags }} -} +{{ partial "page_data.json" . }} diff --git a/layouts/partials/page_data.json b/layouts/partials/page_data.json index 8d90ad9..f400eb8 100644 --- a/layouts/partials/page_data.json +++ b/layouts/partials/page_data.json @@ -1,12 +1,16 @@ -"{{ .RelPermalink }}": { +{ "id": "{{ .UniqueID }}", - "title": "{{ lower .Title }}", + "title": "{{ .Title }}", + "image": "{{ absURL .Params.image }}", "date": "{{ .Date }}", "url": "{{ .Permalink }}", "link": "{{ .RelPermalink }}", "link_title": "{{ .LinkTitle }}", + "content_html": {{ jsonify (.Content | plainify | chomp | htmlUnescape) }}, + "content_text": {{ jsonify .RawContent }}, + "summary": {{ jsonify (.Summary | plainify | chomp | htmlUnescape) }}, "words": {{ .FuzzyWordCount }}, "reading_time": {{ .ReadingTime }}, - "parent": "{{ if .Parent }}{{ lower .Parent.Title }}{{ end }}", + "parent": "{{ if .Parent }}{{ .Parent.Title }}{{ end }}", "tags": {{ jsonify .Params.tags }} }