mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-14 12:25:07 +01:00
add cover image from front matter,
set auto cover grab as backup following similar hugo standard
This commit is contained in:
parent
b52428a2cf
commit
2583a1c4bf
@ -28,6 +28,15 @@
|
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>
|
||||
{{ if .Params.Cover }}
|
||||
{{ if .Params.UseRelativeCover }}{{ printf "%s%s%s%s" "<image src=\"" .Permalink .Params.Cover "\"/>"}}
|
||||
{{ else }}{{ printf "%s%s%s" "<image src=\"" (.Params.Cover | absURL) "\"/>"}}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ $images := .Resources.ByType "image" }}
|
||||
{{ $featured := $images.GetMatch "{*featured*,*cover*,*thumbnail*}" }}
|
||||
{{ with $featured }}{{ printf "%s%s%s" "<image src=\"" $featured.Permalink "\"/>"}}{{ end }}
|
||||
{{ end }}
|
||||
{{ .Summary | html }}
|
||||
</description>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user