feat: support static site header

This commit is contained in:
sixpointcube 2024-06-19 18:09:35 -04:00
parent cea921ccc6
commit 9eab2e631d
2 changed files with 8 additions and 2 deletions

View File

@ -1,7 +1,9 @@
{{ $featured_image := partial "func/GetFeaturedImage.html" . }}
{{ if $featured_image }}
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
<header class="cover bg-top" style="background-image: url('{{ $featured_image }}');">
{{/* <header class="cover bg-top" style="background-image: url('{{ $featured_image }}');"> */}}
{{ $img := resources.Get .Site.Params.site_header_image }}
<header class="cover bg-top" style="background-image: url('{{ $img.RelPermalink }}');">
<div class="bg-black-60">
{{ partial "site-navigation.html" . }}
<div class="tc-l pv6 ph3 ph4-ns">
@ -16,10 +18,12 @@
</div>
</div>
</header>
<div id="search"></div>
{{ else }}
<header>
<div class="{{ .Site.Params.background_color_class | default "bg-black" }}">
<div class="{{ .Site.Params.background_color_class | default "bg-near-black" }}">
{{ partial "site-navigation.html" . }}
</div>
</header>
<div id="search"></div>
{{ end }}

View File

@ -16,6 +16,7 @@
</div>
</div>
</header>
<div id="search"></div>
{{ else }}
<header>
<div class="pb3-m pb6-l {{ .Site.Params.background_color_class | default "bg-black" }}">
@ -31,5 +32,6 @@
{{ end }}
</div>
</div>
<div id="search"></div>
</header>
{{ end }}