From cc78f9d92ca7f508aa3b224de633f31e410f4e85 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Fri, 27 Aug 2021 00:06:10 +0200 Subject: [PATCH] Separate header_image to it's own partial --- layouts/_default/single.html | 1 + layouts/partials/content.html | 11 ----------- layouts/partials/header_image.html | 9 +++++++++ 3 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 layouts/partials/header_image.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 166c188..0c5fa3c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,6 +1,7 @@ {{ define "main" }}
+ {{ partial "header_image.html" . }} {{ partial "content.html" . }}
diff --git a/layouts/partials/content.html b/layouts/partials/content.html index 2d6e857..d14286a 100644 --- a/layouts/partials/content.html +++ b/layouts/partials/content.html @@ -1,14 +1,3 @@ - -{{ 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 }}

{{ if .Params.subtitle }}
{{ markdownify .Params.subtitle | emojify }}
diff --git a/layouts/partials/header_image.html b/layouts/partials/header_image.html new file mode 100644 index 0000000..9657cc2 --- /dev/null +++ b/layouts/partials/header_image.html @@ -0,0 +1,9 @@ +{{ 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 }}