Commit 9c7189a7 authored by Jamie Tanna's avatar Jamie Tanna

Merge branch 'feature/jsonfeed' into 'fork'

Expose JSON feed

See merge request !58
parents 0a9045e2 28b4fc95
{
"version": "https://jsonfeed.org/version/1",
"title": "{{ .Site.Title }}",
"home_page_url": "{{ .Site.Params.LiveSiteUrl }}",
"feed_url": "{{ .Site.Params.LiveSiteUrl }}/feed.json",
"description": "{{ .Site.Params.description }}",
"author": {
"name": "{{ .Site.Params.author }}",
"url": "{{ .Site.Params.LiveSiteUrl }}",
"avatar": "{{ .Site.Params.LiveSiteUrl }}{{ .Site.Params.image }}"
},
"items": [
{{ range $i, $e := .Site.Pages }}
{{ if $i }}, {{ end }}
{
"id": "{{ .Site.Params.LiveSiteUrl }}{{ .URL }}",
"url": "{{ .Site.Params.LiveSiteUrl }}{{ .URL }}",
"title": "{{ .Title }}",
"content_text": {{ jsonify (safeHTML .Plain) }},
"content_html": {{ jsonify .Content }},
"summary": "{{ .Description }}",
{{ $image := .Site.Params.Image }}
{{ if .Params.Image }}
{{ $image = .Params.Image }}
{{ end }}
{{ $imageUrl := printf "%s%s" .Site.Params.LiveSiteUrl $image }}
"image": "{{ $imageUrl }}",
"date_published": {{ dateFormat "2006-01-02T15:04:05-07:00" .Date | jsonify }},
{{- with .GitInfo -}}
"date_modifed": {{ dateFormat "2006-01-02T15:04:05-07:00" .AuthorDate | jsonify }},
{{- end -}}
"tags": {{ .Params.Tags | jsonify }}
}
{{ end }}
]
}
......@@ -100,4 +100,7 @@
<!-- Microsub -->
<link rel="microsub" href="{{ .Site.Params.MicroSubEndpoint }}">
<!-- JSON Feed -->
<link rel="alternate" href="/feed.json" title="JSON Feed" type="application/json" />
</head>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment