From 18f56a78bfd534bff5146a9f12c10e1e0c4f9578 Mon Sep 17 00:00:00 2001 From: alexisben <alex@noesya.coop> Date: Thu, 4 May 2023 11:02:35 +0200 Subject: [PATCH] add option for summary position --- config.yaml | 42 ++++++++++--------- layouts/partials/commons/summary-wrapper.html | 3 +- layouts/partials/header/hero.html | 13 +++++- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/config.yaml b/config.yaml index cae0fce7..7e811742 100644 --- a/config.yaml +++ b/config.yaml @@ -4,9 +4,30 @@ params: enable: false blank: true page: https://gdpr.eu/cookies/ + plausible: false + seo: + title: + separator: "|" + logo: + header: "/assets/images/logo.svg" + footer: "/assets/images/logo.svg" breadcrumb: position: hero-start # hero-start | hero-end | after-hero | none - plausible: + summary: + position: content # content | hero + home: + toc: + disabled: true + organizations: + dark_logo_background: false + pages: + index: + truncate_description: 200 # Set to 0 to disable truncate + partners: + map_marker_icon: '/assets/images/map-marker.svg' + persons: + index: + layout: list # grid | list posts: default_image: false date_format: ":date_long" @@ -16,28 +37,9 @@ params: show_description: true truncate_description: 200 # Set to 0 to disable truncate layout: list # grid | list - pages: - index: - truncate_description: 200 # Set to 0 to disable truncate - partners: - map_marker_icon: '/assets/images/map-marker.svg' - persons: - index: - layout: list # grid | list programs: related_posts: quantity: 4 - home: - toc: - disabled: true - logo: - header: "/assets/images/logo.svg" - footer: "/assets/images/logo.svg" - organizations: - dark_logo_background: false - seo: - title: - separator: "|" image_sizes: design_system: lightbox: diff --git a/layouts/partials/commons/summary-wrapper.html b/layouts/partials/commons/summary-wrapper.html index 7d2b45ff..5432dbe8 100644 --- a/layouts/partials/commons/summary-wrapper.html +++ b/layouts/partials/commons/summary-wrapper.html @@ -1,6 +1,5 @@ {{ $summary := .summary | default (partial "PrepareText" .context.Params.summary) }} - -{{- if eq .site.Params.summary.position "content" -}} +{{- if eq site.Params.summary.position "content" -}} {{- if .block_wrapped -}} <section class="block block-summary"> <div class="container"> diff --git a/layouts/partials/header/hero.html b/layouts/partials/header/hero.html index a172e954..024bf648 100644 --- a/layouts/partials/header/hero.html +++ b/layouts/partials/header/hero.html @@ -1,9 +1,18 @@ {{- $direction := "" -}} {{- $breadcrumb_is_after_hero := eq site.Params.breadcrumb.position "after-hero" -}} +{{- $subtitle := .subtitle -}} {{ if .image }} {{- $direction = partial "GetImageDirection" .image -}} {{ end }} +{{- $summary := partial "PrepareText" .context.Params.summary -}} + +{{ if not $subtitle }} + {{ if and (eq site.Params.summary.position "hero") $summary }} + {{ $subtitle = $summary }} + {{ end }} +{{ end }} + <header class="hero {{ if .image -}}hero--with-image hero--image-{{- $direction -}}{{- end }} {{ if $breadcrumb_is_after_hero -}} hero--no-margin {{- end }}"> <div class="container"> {{- if eq site.Params.breadcrumb.position "hero-start" -}} @@ -12,10 +21,10 @@ {{- end -}} {{- end -}} <div class="content"> - {{- if .subtitle -}} + {{- if $subtitle -}} <hgroup> <h1>{{ partial "PrepareHTML" .title }}</h1> - <p>{{ partial "PrepareHTML" .subtitle }}</p> + <p>{{ partial "PrepareHTML" $subtitle }}</p> </hgroup> {{- else -}} <h1>{{ partial "PrepareHTML" .title }}</h1> -- GitLab