fix(rss): remove featured image width height attr

Throws error when featured image is not found inside page bundle.

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/20
This commit is contained in:
Jimmy Cai 2020-09-28 16:12:52 +02:00 committed by GitHub
parent 12578a5769
commit bd8e03ba61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,7 @@
<description> <description>
{{- $image := partial "helper/image" (dict "Context" . "Type" "rss") -}} {{- $image := partial "helper/image" (dict "Context" . "Type" "rss") -}}
{{- if $image.exists -}} {{- if $image.exists -}}
{{ "<" | html }}img src="{{ $image.permalink | absURL }}" width="{{ $image.resource.Width }}" height="{{ $image.resource.Height }}" alt="Featured image of post {{ .Title }}" {{ "/>" | html}} {{ "<" | html }}img src="{{ $image.permalink | absURL }}" alt="Featured image of post {{ .Title }}" {{ "/>" | html}}
{{- end -}}{{ $content }}</description> {{- end -}}{{ $content }}</description>
</item> </item>
{{ end }} {{ end }}