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
1 changed files with 9 additions and 0 deletions
|
@ -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 a new issue