From fb21e83c33914c86d237633c907cd40cf15f5be7 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Fri, 27 Aug 2021 00:01:44 +0200 Subject: [PATCH] Support local resource images in content --- layouts/partials/content.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/layouts/partials/content.html b/layouts/partials/content.html index aa9c565..2d6e857 100644 --- a/layouts/partials/content.html +++ b/layouts/partials/content.html @@ -1,6 +1,12 @@ {{ if .Params.image }} - + {{ .Scratch.Set "image" .Params.image }} + {{ if hasPrefix .Params.image "resource:" }} + {{ $resource := .Resources.GetMatch (replace .Params.image "resource:" "") }} + {{ .Scratch.Set "image" ($resource.Resize "2000x").RelPermalink }} + {{ end }} + + {{ end }}

{{ .Title }}