mirror of
https://github.com/ItsDrike/itsdrike.com.git
synced 2024-11-09 21:49:41 +00:00
Separate header_image to it's own partial
This commit is contained in:
parent
fb21e83c33
commit
cc78f9d92c
|
@ -1,6 +1,7 @@
|
|||
{{ define "main" }}
|
||||
<div id="main">
|
||||
<div class="container">
|
||||
{{ partial "header_image.html" . }}
|
||||
{{ partial "content.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -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 }}
|
||||
|
||||
<img class="mb-3 header-image" src='{{ .Scratch.Get "image" }}' />
|
||||
{{ end }}
|
||||
|
||||
<h1 class="display-4">{{ .Title }}</h1>
|
||||
{{ if .Params.subtitle }}
|
||||
<h5 class="my-3">{{ markdownify .Params.subtitle | emojify }}</h5>
|
||||
|
|
9
layouts/partials/header_image.html
Normal file
9
layouts/partials/header_image.html
Normal file
|
@ -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 }}
|
||||
|
||||
<img class="mb-3 header-image" src='{{ .Scratch.Get "image" }}' />
|
||||
{{ end }}
|
Loading…
Reference in a new issue