hacker.tours-website/themes/zen/layouts/micro/list.json.json
2024-06-13 22:14:05 +02:00

36 lines
1.4 KiB
JSON

{{ $list := .Pages -}}
{{ $length := (len $list) -}}
{
"version" : "https://jsonfeed.org/version/1",
"title" : "Micro posts {{ i18n "string_on" }} {{ site.Title }}",
"description": "Micro blog {{ i18n "string_by" }} {{ with site.Author.name }}{{ . }}{{ end }}, {{ i18n "string_follow" }} @{{ with $.Param "microusername" }}{{ . }}{{ end }} {{ i18n "string_at" }} https://micro.blog/{{ with $.Param "microusername" }}{{ . }}{{ end }}",
"home_page_url" : "{{ site.BaseURL }}",
{{ with .OutputFormats.Get "JSON" -}}
"feed_url" : "{{ .Permalink }}",
{{ end -}}
{{ with $.Param "icon" -}}
"icon" : "{{ . | absURL }}",
{{ end -}}
{{ with $.Param "favicon" -}}
"favicon" : "{{ . | absURL }}",
{{ end -}}
{{ with site.Author.name -}}
"author" : {
"name" : "{{ . }}"{{ with site.Author.url }},
"url": "{{ . }}"{{ end }}{{ with site.Author.avatar }},
"avatar": "{{ . | absURL }}"{{ end }}
},
{{ end -}}
"items" : [
{{ range $index, $element := $list -}}
{
"date_published" : "{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}",
"date_modified" : "{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}",
"id" : "{{ .Permalink }}",
"url" : "{{ .Permalink }}",
"content_html" : {{ .Content | jsonify }}
}{{ if ne (add $index 1) $length }},{{ end }}
{{ end -}}
]
}