1
Fork 0

Allow using resources as post header images

This commit is contained in:
Jake Howard 2018-01-04 10:50:34 +00:00
parent 0b932a57ef
commit 36426c43fa
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -1,5 +1,10 @@
{{ if .Params.image }}{{ if not .Params.hide_header_image }}
<div class="mb-3 image header-image" data-image="{{ .Params.image }}"></div>
{{ .Scratch.Set "image" .Params.image }}
{{ if hasPrefix .Params.image "resource:" }}
{{ $resource := .Resources.GetByPrefix (replace .Params.image "resource:" "") }}
{{ .Scratch.Set "image" $resource.Permalink }}
{{ end }}
<div class="mb-3 image header-image" data-image='{{ .Scratch.Get "image" }}'></div>
{{ end }}{{ end }}
{{ partial "breadcrumbs/index.html" . }}
<h1 class="display-5">{{ .Title }}</h1>