Explorar el Código

Merge c64c8211e2 into 056246eb62

pull/354/merge
Peter Valdemar Mørch hace 4 años
padre
commit
ba9387be9d
No account linked to committer's email address
Se han modificado 1 ficheros con 11 adiciones y 3 borrados
  1. 11
    3
      layouts/partials/func/GetFeaturedImage.html

+ 11
- 3
layouts/partials/func/GetFeaturedImage.html Ver fichero

@@ -18,13 +18,21 @@
{{/* Declare a new string variable, $linkToCover */}}
{{ $linkToCover := "" }}
{{/* Declare a new string variable, $img, if this is an image resource */}}
{{ $img := "" }}
{{/* Use the value from front matter if present */}}
{{ if .Params.featured_image }}
{{ $linkToCover = .Params.featured_image }}
{{ $img = (.Resources.ByType "image").GetMatch .Params.featured_image }}
{{ if not $img }}
{{ $linkToCover = .Params.featured_image }}
{{ end }}
{{/* Find the first image with 'cover' in the name in this page bundle. */}}
{{ else }}
{{ $img := (.Resources.ByType "image").GetMatch "*cover*" }}
{{ $img = (.Resources.ByType "image").GetMatch "*cover*" }}
{{ end }}
{{ if not $linkToCover }}
{{ with $img }}
{{ $linkToCover = .Permalink }}
{{ end }}

Cargando…
Cancelar
Guardar