From bc09351f1c00e7465e54c6fd3126f9648f3ee4ea Mon Sep 17 00:00:00 2001
From: alexisben <alex@noesya.coop>
Date: Tue, 8 Nov 2022 15:15:33 +0100
Subject: [PATCH] better handling heading in pages

---
 assets/sass/_theme/design-system/header.sass | 4 ++--
 layouts/partials/blocks/templates/pages.html | 2 ++
 layouts/partials/pages/page.html             | 7 ++++---
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/assets/sass/_theme/design-system/header.sass b/assets/sass/_theme/design-system/header.sass
index 87b68672..d72f3861 100644
--- a/assets/sass/_theme/design-system/header.sass
+++ b/assets/sass/_theme/design-system/header.sass
@@ -7,7 +7,6 @@ header[role="banner"]
     width: 100%
     z-index: $zindex-header
     @include media-breakpoint-down(md)
-        padding: 1rem 0
         width: 100%
     &.is-sticky
         background: $header-sticky-background
@@ -26,9 +25,10 @@ header[role="banner"]
         @include media-breakpoint-up(md)
             &:not(:hover)
                 transform: translateY(-100%)
-    
+
     .logo
         img
+            display: block
             height: $header-logo-height
             width: auto
             @include media-breakpoint-up(md)
diff --git a/layouts/partials/blocks/templates/pages.html b/layouts/partials/blocks/templates/pages.html
index c68b0daa..e49b2ce5 100644
--- a/layouts/partials/blocks/templates/pages.html
+++ b/layouts/partials/blocks/templates/pages.html
@@ -70,12 +70,14 @@
 
                 {{- .Scratch.Set "show_image" $show_images -}}
                 {{- .Scratch.Set "show_description" $show_descriptions -}}
+                {{- .Scratch.Set "heading" "h3" -}}
                 {{- if eq $layout "cards" -}}
                   {{- .Scratch.Set "show_more" true -}}
                 {{- end -}}
                 {{- partial "pages/page.html" . -}}
                 {{- .Scratch.Delete "show_image" -}}
                 {{- .Scratch.Delete "show_description" -}}
+                {{- .Scratch.Delete "heading" -}}
                 {{- if eq $layout "cards" -}}
                   {{- .Scratch.Delete "show_more" -}}
                 {{- end -}}
diff --git a/layouts/partials/pages/page.html b/layouts/partials/pages/page.html
index 7aa92817..95cb478b 100644
--- a/layouts/partials/pages/page.html
+++ b/layouts/partials/pages/page.html
@@ -1,6 +1,6 @@
 {{- $class := "page" -}}
 {{- $custom_class := "" -}}
-
+{{- $heading := .Scratch.Get "heading" | default "h2" -}}
 {{- if .Params.bodyclass -}}
   {{ $class = printf "%s page-%s" $class .Params.bodyclass }}
 {{- end -}}
@@ -11,11 +11,12 @@
 {{- end -}}
 <article class="{{ $class }}">
   <div>
-    <p class="title">
+    {{- partial "PrepareHTML" (printf "<%s class='title'>" $heading) -}}
       <a href="{{ .Permalink }}">
         {{- partial "PrepareHTML" .Title -}}
       </a>
-    </p>
+    {{- partial "PrepareHTML" (printf "</%s>" $heading) -}}
+
     {{- if .Scratch.Get "show_description" }}
       {{- if .Params.description_short }}
         <p>{{ partial "PrepareHTML" .Params.description_short }}</p>
-- 
GitLab