Make use of absURL.

This commit is contained in:
Fredrik Jonsson 2017-05-19 14:23:35 +02:00
commit 6748dd5aaf

View file

@ -1,25 +1,24 @@
{{ $baseurl := .Site.BaseURL -}} {{ $list := .Data.Pages -}}
{{ $list := (.Data.Pages) -}}
{{ $length := (len $list) -}} {{ $length := (len $list) -}}
{ {
"version" : "https://jsonfeed.org/version/1", "version" : "https://jsonfeed.org/version/1",
"title" : "{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}", "title" : "{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}",
"description": "Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}", "description": "Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}",
"home_page_url" : "{{ $baseurl }}", "home_page_url" : "{{ .Site.BaseURL }}",
{{ with .OutputFormats.Get "JSON" -}} {{ with .OutputFormats.Get "JSON" -}}
"feed_url" : "{{ .Permalink }}", "feed_url" : "{{ .Permalink }}",
{{ end -}} {{ end -}}
{{ with $.Param "icon" -}} {{ with $.Param "icon" -}}
"icon" : "{{ (print $baseurl .) }}", "icon" : "{{ . | absURL }}",
{{ end -}} {{ end -}}
{{ with $.Param "favicon" -}} {{ with $.Param "favicon" -}}
"favicon" : "{{ (print $baseurl .) }}", "favicon" : "{{ . | absURL }}",
{{ end -}} {{ end -}}
{{ with .Site.Author.name -}} {{ with .Site.Author.name -}}
"author" : { "author" : {
"name" : "{{ . }}"{{ with $.Site.Author.url }}, "name" : "{{ . }}"{{ with $.Site.Author.url }},
"url": "{{ . }}"{{ end }}{{ with $.Site.Author.avatar }}, "url": "{{ . }}"{{ end }}{{ with $.Site.Author.avatar }},
"avatar": "{{ (print $baseurl .) }}"{{ end }} "avatar": "{{ . | absURL }}"{{ end }}
}, },
{{ end -}} {{ end -}}
"items" : [ "items" : [