From 2e35379cafe70d6b7fa50e13a15c9bb2e6a9c81b Mon Sep 17 00:00:00 2001 From: alexisben <alex@noesya.coop> Date: Thu, 15 Dec 2022 13:16:37 +0100 Subject: [PATCH] handle subtitle in hero --- assets/sass/_theme/design-system/hero.sass | 6 +++--- layouts/partials/header/hero.html | 10 +++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/assets/sass/_theme/design-system/hero.sass b/assets/sass/_theme/design-system/hero.sass index 06237592..d99df476 100644 --- a/assets/sass/_theme/design-system/hero.sass +++ b/assets/sass/_theme/design-system/hero.sass @@ -57,14 +57,14 @@ @include media-breakpoint-up(desktop) $negative-margin-bottom: px2rem(150) .content - h1 + > h1, > hgroup width: col(9) &--with-image margin-bottom: $negative-margin-bottom .content display: flex justify-content: space-between - h1 + > h1, > hgroup width: col(7) figure width: col(5) @@ -80,7 +80,7 @@ .breadcrumb padding-right: 50px .content - h1 + > h1, > hgroup width: col(8) figure margin-top: calc(-#{$spacing3} - #{$spacing2}) diff --git a/layouts/partials/header/hero.html b/layouts/partials/header/hero.html index bd845e2d..cccb0071 100644 --- a/layouts/partials/header/hero.html +++ b/layouts/partials/header/hero.html @@ -9,7 +9,15 @@ {{ partial "header/breadcrumbs.html" .context }} {{- end -}} <div class="content"> - <h1>{{ partial "PrepareHTML" .title }}</h1> + {{- if .subtitle -}} + <hgroup> + <h1>{{ partial "PrepareHTML" .title }}</h1> + <p>{{ partial "PrepareHTML" .subtitle }}</p> + </hgroup> + {{- else -}} + <h1>{{ partial "PrepareHTML" .title }}</h1> + {{- end -}} + </hgroup> {{- if .image }} <figure> {{ partial "commons/image.html" -- GitLab