Browse Source

trying to make some RSS amendments

master
jk 5 years ago
parent
commit
f2f65487c1
  1. 11
      content/photo/5eb43064/index.md
  2. 7
      layouts/_default/rss.xml

11
content/photo/5eb43064/index.md

@ -1,11 +0,0 @@
---
date: '2020-05-07 16:59:32'
draft: false
photo:
- 'https://micropub.rocks/media/sunset.jpg'
posttype: photo
slug: 5eb43064
thumbnail:
- 'https://micropub.rocks/media/sunset.jpg'
---
Micropub test of creating a photo referenced by URL

7
layouts/_default/rss.xml

@ -22,6 +22,13 @@
<description>{{ .Content | html }} <description>{{ .Content | html }}
{{ range .Page.Params.Photo }}{{ printf "<img src=%q />" . | html }}{{end}} {{ range .Page.Params.Photo }}{{ printf "<img src=%q />" . | html }}{{end}}
({{ .Permalink }})</description> ({{ .Permalink }})</description>
{{ 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" />
{{ else }}
{{ $image_location := replace (printf "%s" .) "https://jk.nipponalba.scot/" "static/"}}{{$image := readFile $image_location }}{{$len := len $image}}<enclosure url="https://jk.nipponalba.scot{{.}}" length="{{$len}}" type="image/jpeg" />
{{ end }}
{{ end }}
</item> </item>
{{ end }} {{ end }}
</channel> </channel>