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 }}
|
{{ range $i, $e := .Data.Pages.ByTitle }}
|
||||||
{{ if $i }}, {{ end }}
|
{{ if $i }}, {{ end }}
|
||||||
{{ partial "page_data.json" . }}
|
"{{ .RelPermalink }}": {{ partial "page_data.json" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1 @@
|
||||||
{
|
{{ partial "page_data.json" . }}
|
||||||
"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 }}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
"{{ .RelPermalink }}": {
|
{
|
||||||
"id": "{{ .UniqueID }}",
|
"id": "{{ .UniqueID }}",
|
||||||
"title": "{{ lower .Title }}",
|
"title": "{{ .Title }}",
|
||||||
|
"image": "{{ absURL .Params.image }}",
|
||||||
"date": "{{ .Date }}",
|
"date": "{{ .Date }}",
|
||||||
"url": "{{ .Permalink }}",
|
"url": "{{ .Permalink }}",
|
||||||
"link": "{{ .RelPermalink }}",
|
"link": "{{ .RelPermalink }}",
|
||||||
"link_title": "{{ .LinkTitle }}",
|
"link_title": "{{ .LinkTitle }}",
|
||||||
|
"content_html": {{ jsonify (.Content | plainify | chomp | htmlUnescape) }},
|
||||||
|
"content_text": {{ jsonify .RawContent }},
|
||||||
|
"summary": {{ jsonify (.Summary | plainify | chomp | htmlUnescape) }},
|
||||||
"words": {{ .FuzzyWordCount }},
|
"words": {{ .FuzzyWordCount }},
|
||||||
"reading_time": {{ .ReadingTime }},
|
"reading_time": {{ .ReadingTime }},
|
||||||
"parent": "{{ if .Parent }}{{ lower .Parent.Title }}{{ end }}",
|
"parent": "{{ if .Parent }}{{ .Parent.Title }}{{ end }}",
|
||||||
"tags": {{ jsonify .Params.tags }}
|
"tags": {{ jsonify .Params.tags }}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue