small fixes

This commit is contained in:
teldra 2022-04-05 12:49:50 +02:00
parent 6f233a5412
commit 6487b1a1e1
3 changed files with 37 additions and 5 deletions

View File

@ -0,0 +1,14 @@
---
title: "asd"
date: 2022-04-05T12:49:11+02:00
newscategories: []
eventcategories: []
when: ""
featured: false
covid: ""
contact: ""
price: ""
draft: false
tags: []
---
asdasd

View File

@ -72,3 +72,6 @@ other = "Kurdi"
[all] [all]
other = "Alle" other = "Alle"
[updated]
other = "Aktualisiert"

View File

@ -56,15 +56,30 @@
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}-{{ $hash }}</guid> <guid>{{ .Permalink }}-{{ $hash }}</guid>
<description> <description>
{{- if $when -}}{{- $when | plainify -}}{{- end -}} {{ $updated := "" }}
{{ if gt .Lastmod .Date }}
{{ $updated = i18n "updated" }}
{{ end }}
{{- if $when -}}
{{- $when = $when -}}
{{- end -}}
{{- $c := .Content -}} {{- $c := .Content -}}
{{- $c := replace $c "<img" "<img width=\"600\"" -}} {{- $c := replace $c "<img" "<img width=\"600\"" -}}
{{- if $when -}}{{- $c = printf "<p>%s</p>%s" $when $c -}}{{- end -}} {{- if $when -}}
{{- $c = printf "<p>%s</p>%s" $when $c -}}
{{- end -}}
{{- if ne $updated "" -}}
{{- $c = printf "<p>%s</p>%s" $updated $c -}}
{{- end -}}
{{- $img := index (.Resources.ByType "image") 0 -}} {{- $img := index (.Resources.ByType "image") 0 -}}
{{- with $img -}} {{- with $img -}}
{{- $img := .Resize "640x" -}} {{- $img := .Resize "640x" -}}
{{- printf "<![CDATA[%s<img src=\"%s\" width=\"%d\" height=\"%d\"/>]]>" $c $img.Permalink $img.Width $img.Height | safeHTML -}} {{- printf "<![CDATA[%s<img src=\"%s\" width=\"%d\" height=\"%d\"/>]]>" $c $img.Permalink $img.Width $img.Height | safeHTML -}}
{{ else }}
{{- printf "<![CDATA[%s]]>" $c | safeHTML -}}
{{- end -}} {{- end -}}
</description> </description>