Reuse page data shortcode for JSON data
This commit is contained in:
parent
13e3f5291f
commit
85e2a031b6
3 changed files with 9 additions and 16 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
{{ range $i, $e := .Data.Pages.ByTitle }}
|
||||
{{ if $i }}, {{ end }}
|
||||
{{ partial "page_data.json" . }}
|
||||
"{{ .RelPermalink }}": {{ partial "page_data.json" . }}
|
||||
{{ end }}
|
||||
}
|
||||
|
|
|
@ -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" . }}
|
||||
|
|
|
@ -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 }}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue