1
0
mirror of https://github.com/danbee/danbarber.me.hugo.git synced 2025-03-04 08:59:18 +00:00
danbarber.me.hugo/layouts/index.json

31 lines
840 B
JSON

{{ $imageSize := default "600x600" }}
{
"version": "https://jsonfeed.org/version/1",
"title": "{{ .Site.Title }}",
"home_page_url": "{{ .Site.BaseURL }}",
"feed_url": "{{ .Permalink}}",
"items": [
{{ range $i, $e := first 20 .Site.RegularPages }}
{{ if $i }}, {{ end }}
{
"id": "{{ .Permalink }}",
"title": "{{ .Title }}",
{{ if .Params.image }}
{{ $src := .Page.Resources.GetMatch (.Params.image) }}
{{ $image := $src.Fit $imageSize }}
"image": "{{ $image.RelPermalink }}",
{{ end }}
{{ if .Params.categories }}
"tags": ["{{ delimit .Params.categories "," }}"],
{{ end }}
"content_html": {{ .Content | jsonify }},
"url": "{{ .Permalink }}",
"date_published": "{{ .Date.Format "2006-01-02T15:04:05-07:00" }}"
}
{{ end }}
]
}