From 36426c43fa0fba4e5c93633967ce16afbe4afa2e Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 4 Jan 2018 10:50:34 +0000 Subject: [PATCH] Allow using resources as post header images --- layouts/partials/content.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layouts/partials/content.html b/layouts/partials/content.html index a5574f3..9b80e5d 100644 --- a/layouts/partials/content.html +++ b/layouts/partials/content.html @@ -1,5 +1,10 @@ {{ if .Params.image }}{{ if not .Params.hide_header_image }} -
+ {{ .Scratch.Set "image" .Params.image }} + {{ if hasPrefix .Params.image "resource:" }} + {{ $resource := .Resources.GetByPrefix (replace .Params.image "resource:" "") }} + {{ .Scratch.Set "image" $resource.Permalink }} + {{ end }} +
{{ end }}{{ end }} {{ partial "breadcrumbs/index.html" . }}

{{ .Title }}