Browse Source

fixed rss?

master
jk 4 years ago
parent
commit
386c7e9d81
  1. 7
      layouts/_default/rss.xml

7
layouts/_default/rss.xml

@ -20,14 +20,15 @@
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | plainify }}
({{ .Permalink }})</description>
({{ .Permalink }})
{{ range .Params.Photo }}
{{ if not ( in . "http" ) }}
{{ $image_location := printf "static/%s" .}}{{$image := readFile $image_location }}{{$len := len $image}}<enclosure url="https://jk.nipponalba.scot{{.}}" length="{{$len}}" type="image/jpeg" />
<media:content xmlns:media="http://search.yahoo.com/mrss" url="https://jk.nipponalba.scot{{.}}" medium="image" type="image/jpeg"/>
{{ else }}
{{ $image_location := replace (printf "%s" .) "https://jk.nipponalba.scot/" "static/"}}{{$image := readFile $image_location }}{{$len := len $image}}<enclosure url="{{.}}" length="{{$len}}" type="image/jpeg" />
<media:content xmlns:media="http://search.yahoo.com/mrss" url="{{.}}" medium="image" type="image/jpeg"/>
{{ end }}
{{ end }}
</description>
</item>
{{ end }}
</channel>