mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-24 16:55: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}}
|
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||||
<guid>{{ .Permalink }}</guid>
|
<guid>{{ .Permalink }}</guid>
|
||||||
<description>
|
<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 }}
|
{{ .Summary | html }}
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user