mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-21 15:25:08 +01:00
better printf style
This commit is contained in:
parent
f35a6c88a1
commit
005e9fca71
@ -42,13 +42,13 @@
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>
|
||||
{{ if .Params.Cover }}
|
||||
{{ if .Params.UseRelativeCover }}{{ printf "%s%s%s%s" "<img src=\"" .Permalink .Params.Cover "\"/>"}}
|
||||
{{ else }}{{ printf "%s%s%s" "<img src=\"" (.Params.Cover | absURL) "\"/>"}}
|
||||
{{ if .Params.UseRelativeCover }}{{ printf "<img src=\"%s%s\"/>" .Permalink .Params.Cover }}
|
||||
{{ else }}{{ printf "<img src=\"%s\"/>" (.Params.Cover | absURL) }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ $images := .Resources.ByType "image" }}
|
||||
{{ $featured := $images.GetMatch "{*featured*,*cover*,*thumbnail*}" }}
|
||||
{{ with $featured }}{{ printf "%s%s%s" "<img src=\"" $featured.Permalink "\"/>"}}{{ end }}
|
||||
{{ with $featured }}{{ printf "<img src=\"%s\"/>" $featured.Permalink }}{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.RssFullText }}{{ .Content | html }}
|
||||
|
Loading…
Reference in New Issue
Block a user