refactor: code fixes and default center of page headers

Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
This commit is contained in:
Patrick Kollitsch 2024-10-21 15:29:14 +07:00
parent 2ed5c551dd
commit f6a3af3f4a
No known key found for this signature in database
GPG Key ID: 5A5360B005AD68C7
2 changed files with 8 additions and 4 deletions

View File

@ -1,8 +1,10 @@
{{ $featured_image := partial "func/GetFeaturedImage.html" . }} {{ $featured_image := partial "func/GetFeaturedImage.html" . }}
{{ if $featured_image }} {{ if $featured_image }}
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
<header class="{{ .Params.featured_image_class | .Site.Params.featured_image_class | default "cover bg-top" }}" style="background-image: url('{{ $featured_image }}');"> {{ $featured_image_class := .Params.featured_image_class | default "cover bg-center" }}
<div class="{{ .Params.cover_dimming_class | .Site.Params.cover_dimming_class | default "bg-black-60" }}"> {{ $cover_dimming_class := .Params.cover_dimming_class | default "bg-black-60" }}
<header class="{{ $featured_image_class }}" style="background-image: url('{{ $featured_image }}');">
<div class="{{ $cover_dimming_class }}">
{{ partial "site-navigation.html" . }} {{ partial "site-navigation.html" . }}
<div class="tc-l pv6 ph3 ph4-ns"> <div class="tc-l pv6 ph3 ph4-ns">
{{ if not .Params.omit_header_text }} {{ if not .Params.omit_header_text }}

View File

@ -1,8 +1,10 @@
{{ $featured_image := partial "func/GetFeaturedImage.html" . }} {{ $featured_image := partial "func/GetFeaturedImage.html" . }}
{{ if $featured_image }} {{ if $featured_image }}
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
<header class="{{ .Site.Params.featured_image_class | default "cover bg-top" }}" style="background-image: url('{{ $featured_image }}');"> {{ $featured_image_class := site.Params.featured_image_class | default "cover bg-top" }}
<div class="{{ .Site.Params.cover_dimming_class | default "bg-black-60" }}"> <header class="{{ $featured_image_class }}" style="background-image: url('{{ $featured_image }}');">
{{ $cover_dimming_class := site.Params.cover_dimming_class | default "bg-black-60" }}
<div class="{{ $cover_dimming_class }}">
{{ partial "site-navigation.html" .}} {{ partial "site-navigation.html" .}}
<div class="tc-l pv4 pv6-l ph3 ph4-ns"> <div class="tc-l pv4 pv6-l ph3 ph4-ns">
<h1 class="f2 f-subheadline-l fw2 white-90 mb0 lh-title"> <h1 class="f2 f-subheadline-l fw2 white-90 mb0 lh-title">