small fixes

This commit is contained in:
teldra 2022-04-05 12:11:15 +02:00
parent 3f0ab2285f
commit 72ff357ad5
1 changed files with 8 additions and 11 deletions

View File

@ -6,9 +6,6 @@
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- if eq .Section "news" -}}
{{- $pages = where .Site.RegularPages "Type" "in" site.Params.mainSections -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
@ -59,14 +56,14 @@
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}-{{ $hash }}</guid>
<description>
{{ if $when }}{{ printf "<![CDATA[<p><b>%s</b></p>]]>" $when | safeHTML }}{{ end }}
{{ printf "<![CDATA[%s]]>" .Content | plainify }}
{{ $img := index (.Resources.ByType "image") 0 }}
{{ with $img }}
{{ $img := .Resize "640x" }}
{{ printf "<![CDATA[<img src=\"%s\" width=\"%d\" height=\"%d\"/>]]>" $img.Permalink $img.Width $img.Height | safeHTML }}
{{ end }}
{{- if $when -}}{{- $when | plainify -}}{{- end -}}
{{- $c := .Content | plainify -}}
{{- if $when -}}{{- $c = printf "<p>%s</p>%s" $when $c -}}{{- end -}}
{{- $img := index (.Resources.ByType "image") 0 -}}
{{- with $img -}}
{{- $img := .Resize "640x" -}}
{{- printf "<![CDATA[%s<img src=\"%s\" width=\"%d\" height=\"%d\"/>]]>" $c $img.Permalink $img.Width $img.Height | safeHTML -}}
{{- end -}}
</description>
</item>