Merge commit 'e186c5d6f740bbdb62d2c6ea304977603a55e59a' as 'themes/paperesque'
This commit is contained in:
15
themes/paperesque/layouts/partials/feature_image.html
Normal file
15
themes/paperesque/layouts/partials/feature_image.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{/* The featured image, using the same rules as what the twitter cards use. */}}
|
||||
{{- with $.Params.images -}}
|
||||
{{- index . 0 | absURL -}}
|
||||
{{- else -}}
|
||||
{{- $images := $.Resources.ByType "image" -}}
|
||||
{{- $featured := $images.GetMatch "*feature*" -}}
|
||||
{{- $featured := cond (ne $featured nil) $featured ($images.GetMatch "{*cover*,*thumbnail*}") -}}
|
||||
{{- with $featured -}}
|
||||
{{- $featured.Permalink -}}
|
||||
{{- else -}}
|
||||
{{- with $.Site.Params.images -}}
|
||||
{{- index . 0 | absURL -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
Reference in New Issue
Block a user