diff --git a/assets/sass/_theme/_utils.sass b/assets/sass/_theme/_utils.sass index e9b62ec727c6be38e6b9546f752a9f3a3d473d72..690dca386eb5dc795833ec7469b5aa7a17c66ec5 100644 --- a/assets/sass/_theme/_utils.sass +++ b/assets/sass/_theme/_utils.sass @@ -182,7 +182,7 @@ overflow: hidden img object-fit: cover - h1, h2, h3, h4 + h2, h3 @include h3 a display: block diff --git a/assets/sass/_theme/blocks/base.sass b/assets/sass/_theme/blocks/base.sass index 2669479499655ac7862c51d0761886f804804386..bea6b3ba7e9108bf368660cb409bdf6ec71964ea 100644 --- a/assets/sass/_theme/blocks/base.sass +++ b/assets/sass/_theme/blocks/base.sass @@ -2,17 +2,19 @@ padding-top: $spacing3 padding-bottom: $spacing3 // Mobile & full-width - h2, h3 + h2 @include h2 // Desktop with sidebar @include media-breakpoint-up(desktop) @include in-page-without-sidebar - h2, h3 + h2 @include h5 .top - h2, h3 + h2:not(.hidden) + .description - margin-top: $spacing2 + margin-top: $spacing1 + @include media-breakpoint-up(desktop) + margin-top: $spacing2 // Specific $backgrounded_blocks: ".block-call_to_action, .block-chapter--accent_background, .block-chapter--alt_background, .block-timeline--horizontal, .block-pages--cards" diff --git a/assets/sass/_theme/blocks/image.sass b/assets/sass/_theme/blocks/image.sass index 306e85520e44b7cdc5ac38602607ce768135ebe4..4e186ab582b19c5199b226b0d4ed61095e9e5884 100644 --- a/assets/sass/_theme/blocks/image.sass +++ b/assets/sass/_theme/blocks/image.sass @@ -27,29 +27,41 @@ width: auto @include in-page-without-sidebar @include media-breakpoint-up(desktop) - .block-content - position: relative - .top - position: absolute - width: col(5) figure - display: flex - align-items: flex-end - > a - width: col(7) - margin-left: half($grid-gutter) - display: block - order: 2 + img + max-height: $block-image-max-height-without-sidebar + // max-height: calc(100vh - var(--header-height)) + width: auto + max-width: 100% + &.image-portrait + .block-content + position: relative + .top + position: absolute + width: col(5) + figure + display: flex + align-items: flex-end + > a + width: col(7) + margin-left: half($grid-gutter) + display: block + order: 2 + picture + margin-left: 0 + margin-right: -$grid-gutter + figcaption + width: calc(#{col(5)} + #{$grid-gutter} / 2) + order: 1 + display: block + text-align: right + &.image-landscape picture margin-left: 0 - margin-right: -$grid-gutter - img - max-height: $block-image-max-height-without-sidebar + margin-right: 0 figcaption - width: calc(#{col(5)} + #{$grid-gutter} / 2) - order: 1 - display: block - text-align: right - img - max-height: calc(100vh - var(--header-height)) - width: auto \ No newline at end of file + display: flex + justify-content: space-between + align-items: baseline + .credit + margin-top: 0 \ No newline at end of file diff --git a/assets/sass/_theme/blocks/key_figures.sass b/assets/sass/_theme/blocks/key_figures.sass index 842b18935e4f724fcfca2d69a0b9fdf1cf5d2bd3..caaa63dc1f9abd61a4536500f8679fb7e15c2439 100644 --- a/assets/sass/_theme/blocks/key_figures.sass +++ b/assets/sass/_theme/blocks/key_figures.sass @@ -10,7 +10,7 @@ @include grid(4, desktop) &.odd-items @include grid(3, desktop) - .top + ul + .top:not(.hidden) + ul margin-top: $spacing2 dl margin-bottom: 0 diff --git a/assets/sass/_theme/blocks/pages.sass b/assets/sass/_theme/blocks/pages.sass index 9ef5f3a5f3ecf87ea9a4402de4248f0e6f28f12b..851d2b3f590676412d1cff3315d9ff1826301f38 100644 --- a/assets/sass/_theme/blocks/pages.sass +++ b/assets/sass/_theme/blocks/pages.sass @@ -19,7 +19,7 @@ aspect-ratio: 16/9 object-fit: cover width: 100% - h1 + h3 @include h3 a text-decoration: none @@ -33,7 +33,7 @@ @include media-breakpoint-down(desktop) .top - h2, h3 + h2 @include h5 .description @include h2 @@ -44,7 +44,7 @@ @include media-breakpoint-up(desktop) .top @include grid - h2, h3 + h2 grid-column: 1 / 5 a text-decoration: none @@ -140,7 +140,6 @@ @include meta @include icon(arrow, before, true) padding-right: $spacing0 - @include hover-translate-icon(before, 5) @include link text-decoration-color: rgba(0,0,0,0) @@ -173,7 +172,7 @@ display: block grid-column: 1 / 8 margin-bottom: 0 - .top + .description + .top:not(.hidden) + .description grid-column: 1 / 8 grid-row: 2 / 3 // Default behavior (without page description) diff --git a/assets/sass/_theme/blocks/posts.sass b/assets/sass/_theme/blocks/posts.sass index 43fbd107643e99fa0694b987316858bff2e25538..0fe62a5ac282abaa7757ecca8cf6523f1522acba 100644 --- a/assets/sass/_theme/blocks/posts.sass +++ b/assets/sass/_theme/blocks/posts.sass @@ -8,7 +8,7 @@ @include grid(1) @include grid($block-posts-grid-columns, desktop) article - h1 + h3 a @include stretched-link text-decoration: none @@ -48,7 +48,7 @@ display: flex flex-direction: column // width: 70% - h1 + h3 margin-bottom: 0 time margin-top: half($spacing0) @@ -56,16 +56,9 @@ p margin-top: half($spacing0) order: 4 - // h1, time, p - // padding-right: calc(30% + #{$spacing1}) .media display: none order: 3 - // position: absolute - // width: 30% - - // top: 0 - // right: 0 @include in-page-with-sidebar article @@ -102,7 +95,7 @@ margin-top: 0.3em &--highlight .highlight-post - h1 + h3 margin-bottom: $spacing0 .media margin-bottom: $spacing0 @@ -134,7 +127,7 @@ .list article @include grid(8, desktop, 0, 0) - h1 + h3 grid-column: 1 / 7 .post-categories grid-column: 1 / 7 @@ -154,11 +147,11 @@ @include media-breakpoint-up(desktop) .highlight - h1 + h3 @include h2 .list article - h1 + h3 @include h4 @include in-page-without-sidebar .highlight diff --git a/assets/sass/_theme/blocks/timeline.sass b/assets/sass/_theme/blocks/timeline.sass index 472ef37d30d42da2014c4451ce832b2ca387a9c4..1197ee05232cfe37b89972fb0575789d2dded4a1 100644 --- a/assets/sass/_theme/blocks/timeline.sass +++ b/assets/sass/_theme/blocks/timeline.sass @@ -111,8 +111,9 @@ width: 50% .title + display: block min-height: var(--min-title-height) - margin-bottom: $spacing1 + padding-bottom: $spacing1 @include signature .description @include small diff --git a/assets/sass/_theme/design-system/layout.sass b/assets/sass/_theme/design-system/layout.sass index 2a8a63d3708b8ff7fb4ae80f37985d8f1ddd16da..e51b956ba9cdcb3d66c05af199682344a069c4b2 100644 --- a/assets/sass/_theme/design-system/layout.sass +++ b/assets/sass/_theme/design-system/layout.sass @@ -43,6 +43,9 @@ iframe .hero + & margin-top: $spacing3 +.hidden + display: none + ul, ol // https://since1979.dev/aligning-your-lists-with-your-text/ diff --git a/assets/sass/_theme/sections/organizations.sass b/assets/sass/_theme/sections/organizations.sass index 0c080965a1dcb939456573a7ffa30caf5d01fa7d..19b8db695408f11ecc135b2b30ebb8a4d8521b01 100644 --- a/assets/sass/_theme/sections/organizations.sass +++ b/assets/sass/_theme/sections/organizations.sass @@ -1,7 +1,7 @@ .organization @include article position: relative - h1 + h2 @include meta a @include stretched-link diff --git a/assets/sass/_theme/sections/posts.sass b/assets/sass/_theme/sections/posts.sass index 352fdb7e4df9c61e2e96e4a3a3c5a616f4ccf6dd..cbf241a8a7dc8909b72717475a7cdc564ac7648e 100644 --- a/assets/sass/_theme/sections/posts.sass +++ b/assets/sass/_theme/sections/posts.sass @@ -28,7 +28,7 @@ margin-bottom: $spacing1 padding-bottom: $spacing1 flex-direction: row - h1 + p + h2 + p, h3 + p margin-top: $spacing0 @include media-breakpoint-up(desktop) @include grid @@ -58,7 +58,7 @@ right: 0 top: 0 div:not(.media) - h1, h2, h3, + h2, h3, p max-width: col(6, 9) .posts--grid diff --git a/assets/sass/_theme/sections/programs.sass b/assets/sass/_theme/sections/programs.sass index f3fc2944807e0aadd0e61839dcfb0b3d520a09a6..cee274383e3067218ae558e0e20fd35185d16c94 100644 --- a/assets/sass/_theme/sections/programs.sass +++ b/assets/sass/_theme/sections/programs.sass @@ -103,11 +103,13 @@ ol.programs .blocks section > * + * margin-top: 0 - h3 + h2 @include h3 @include media-breakpoint-down(desktop) + padding-top: $spacing3 margin-left: half(-$grid-gutter-sm) margin-right: half(-$grid-gutter-sm) + @include media-breakpoint-up(desktop) .container padding-left: 0 @@ -117,7 +119,7 @@ ol.programs @include media-breakpoint-down(desktop) .document-content .content - h2 + > h2 margin-bottom: $spacing2 section:not(:first-child):not(.block) margin-top: $spacing3 diff --git a/i18n/en.yml b/i18n/en.yml index e9eebe244869d11e85137ee9072a664ea3005a89..90f5e8f3f106b546243c14c023452583fbd37cd2 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -1,3 +1,42 @@ +blocks: + call_to_action: + title: Call to action + chapter: + title: Chapter + contact: + title: Contact + datatable: + title: Table + definitions: + title: Definitions + embed: + title: HTML embed + files: + title: Files + gallery: + title: Gallery + image: + title: Image + key_figures: + title: Key figures + organization_chart: + title: People + pages: + title: Pages + partners: + title: Organizations + posts: + title: Posts + programs: + title: Programs + testimonials: + title: Testimonials + timeline: + title: Timeline + next: Next element + previous: Previous element + video: + title: Video categories: no_post: No post in this category see_more: diff --git a/i18n/fr.yml b/i18n/fr.yml index b685c5ca17a518b9337d59a3ace7ff2469fc448f..2487a98682868ecf88c8011742a3ad2e14c9e308 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -1,3 +1,42 @@ +blocks: + call_to_action: + title: Appel à actions + chapter: + title: Chapitre + contact: + title: Contact + datatable: + title: Tableau + definitions: + title: Définitions + embed: + title: Intégration HTML + files: + title: Fichiers + gallery: + title: Galerie + image: + title: Image + key_figures: + title: Chiffres-clés + organization_chart: + title: Personnes + pages: + title: Pages + partners: + title: Organisations + posts: + title: Actualités + programs: + title: Formations + testimonials: + title: Témoignages + timeline: + title: Frise chronologique + next: Élément suivant + previous: Élément précédent + video: + title: Vidéo categories: no_post: Aucun article dans cette catégorie see_more: @@ -178,8 +217,4 @@ volumes: plural_name: Volumes singular_name: Volume table_contents: Table des matières - volume_number: Volume {{ .Number }} -blocks: - timeline: - next: Élément suivant - previous: Élément précédent + volume_number: Volume {{ .Number }} \ No newline at end of file diff --git a/layouts/partials/blocks/default_title.html b/layouts/partials/blocks/default_title.html new file mode 100644 index 0000000000000000000000000000000000000000..c0c1d655904d224db8b6748477211859919769a8 --- /dev/null +++ b/layouts/partials/blocks/default_title.html @@ -0,0 +1 @@ +<h2 class="hidden">{{- i18n (printf "blocks.%s.title" . ) -}}</h2> \ No newline at end of file diff --git a/layouts/partials/blocks/templates/call_to_action.html b/layouts/partials/blocks/templates/call_to_action.html index a4bba7c41d979df3b527e6f9e8fccb163ff6c0c0..e3ad825a8b84472c59546f316bb1c3228facf422 100644 --- a/layouts/partials/blocks/templates/call_to_action.html +++ b/layouts/partials/blocks/templates/call_to_action.html @@ -1,5 +1,5 @@ -{{- $context := .context -}} {{- $position := .block.position -}} +{{- $template := .block.template -}} {{- $title := .block.title -}} {{- with .block.data -}} {{- $buttons := and .button.text .button_secondary.text -}} @@ -8,10 +8,12 @@ <div class="block-content"> <div class="call_to_action call_to_action--with{{ if not .image }}out{{ end }}-image"> <div> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} + <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ end -}} + {{- if (partial "GetTextFromHTML" .text) }} <div class="description"> {{ partial "PrepareHTML" .text }} @@ -36,7 +38,6 @@ {{- end -}} </div> {{- end -}} - </div> {{ partial "commons/image.html" diff --git a/layouts/partials/blocks/templates/chapter.html b/layouts/partials/blocks/templates/chapter.html index 3f7f11c71590d25bb1644baae7c2ac9ec449f1e9..9e4fdf1202b7af01f273d854d1b631cf67439ded 100644 --- a/layouts/partials/blocks/templates/chapter.html +++ b/layouts/partials/blocks/templates/chapter.html @@ -1,9 +1,10 @@ -{{- $context := .context -}} {{- $position := .block.position -}} +{{- $template := .block.template -}} {{- $title := .block.title -}} {{- $layout := .block.data.layout | default "no_background" -}} {{- $class := "block block-chapter" -}} {{- $image_class := "" -}} + {{- with .block.data -}} {{ if .image }} {{- $class = printf "%s block-chapter--with-image" $class -}} @@ -17,12 +18,11 @@ <div class="block-content"> <div class="chapter"> <div class="text"> - {{ if $title -}} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} <div class="top"> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + <h2>{{ partial "PrepareHTML" $title }}</h2> </div> {{ end -}} {{ if (partial "GetTextFromHTML" .text) -}} diff --git a/layouts/partials/blocks/templates/contact.html b/layouts/partials/blocks/templates/contact.html index d9b1c6f9c4a3fe42b8f58a385d35971a112a5b49..41e3fd30c2d235337f2163e7d41c40c98a71de57 100644 --- a/layouts/partials/blocks/templates/contact.html +++ b/layouts/partials/blocks/templates/contact.html @@ -1,4 +1,4 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- $class := "block block-contact" -}} @@ -6,12 +6,11 @@ <section class="{{ $class }}{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> - {{ if $title -}} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} <div class="top"> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + <h2>{{ partial "PrepareHTML" $title }}</h2> {{- if .description }} <div class="description"> {{ partial "PrepareHTML" .description }} diff --git a/layouts/partials/blocks/templates/datatable.html b/layouts/partials/blocks/templates/datatable.html index be44f5f01babd25930a09624632066ff02c31171..c8c19a3716ef3e98dd5995f99bdd9fff97ca0e7c 100644 --- a/layouts/partials/blocks/templates/datatable.html +++ b/layouts/partials/blocks/templates/datatable.html @@ -1,4 +1,4 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- $title := .block.title -}} @@ -6,12 +6,11 @@ <section class="block block-datatable{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> - {{- if $title }} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} <div class="top"> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + <h2>{{ partial "PrepareHTML" $title }}</h2> </div> {{ end -}} <div class="table-responsive"> diff --git a/layouts/partials/blocks/templates/definitions.html b/layouts/partials/blocks/templates/definitions.html index b0e7976104b1e6c24d598196257fe2b4bafba541..f82a80b41434206aca1facbd23b08f79612877ca 100644 --- a/layouts/partials/blocks/templates/definitions.html +++ b/layouts/partials/blocks/templates/definitions.html @@ -1,16 +1,15 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- with .block.data -}} <section class="block block-definitions{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> - {{- if $title }} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} <div class="top"> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + <h2>{{ partial "PrepareHTML" $title }}</h2> </div> {{ end -}} <div class="definitions"> diff --git a/layouts/partials/blocks/templates/embed.html b/layouts/partials/blocks/templates/embed.html index 263eb21ec01aa8e47acd0342619eef9f455fb82c..6b67aaf9942ad8026e96e01d9959214038df4213 100644 --- a/layouts/partials/blocks/templates/embed.html +++ b/layouts/partials/blocks/templates/embed.html @@ -1,16 +1,15 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- with .block.data -}} <section class="block block-embed{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> - {{- if $title }} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} <div class="top"> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + <h2>{{ partial "PrepareHTML" $title }}</h2> </div> {{ end -}} diff --git a/layouts/partials/blocks/templates/files.html b/layouts/partials/blocks/templates/files.html index fc301198a1c98eb948ec239f917c8db88492bba4..c811af648d735266f9a015cbb41601b517e5fca8 100644 --- a/layouts/partials/blocks/templates/files.html +++ b/layouts/partials/blocks/templates/files.html @@ -1,4 +1,4 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- with .block.data -}} @@ -7,10 +7,11 @@ <div class="block-content"> {{- if or $title .description }} <div class="top"> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} + <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ end -}} {{- if .description }} <div class="description"> {{ partial "PrepareHTML" .description }} diff --git a/layouts/partials/blocks/templates/gallery.html b/layouts/partials/blocks/templates/gallery.html index 6f2832675e53a6d5a24b8620bad6eaa64ba85d48..61580b0c358231dec0630a73dbed25c5bdaaa5fe 100644 --- a/layouts/partials/blocks/templates/gallery.html +++ b/layouts/partials/blocks/templates/gallery.html @@ -1,4 +1,4 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- $layout_class := "block-gallery--grid" -}} @@ -12,11 +12,10 @@ <div class="block-content"> {{- if (or $title .description) }} <div class="top"> - {{- if $title }} - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} + <h2>{{ partial "PrepareHTML" $title }}</h2> {{ end -}} {{- if .description }} <div class="description"> diff --git a/layouts/partials/blocks/templates/image.html b/layouts/partials/blocks/templates/image.html index 0ef25bc1afa269d9c05d3a1f29c9d20328c0ded5..2bc4ef561c90b319677aa6348178501b123eeada 100644 --- a/layouts/partials/blocks/templates/image.html +++ b/layouts/partials/blocks/templates/image.html @@ -1,35 +1,29 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} +{{- $image_class := "" -}} {{- with .block.data -}} {{- $text := .text -}} {{- $buttons := and .button.text .button_secondary.text -}} - <section class="block block-image{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> + {{- if .image -}} + {{- $image_class = printf "image-%s" (partial "GetImageDirection" .image ) -}} + {{- end -}} + <section class="block block-image{{ if $title }} block-with-title{{ end }} {{ $image_class -}}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> - - {{ if $title -}} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} <div class="top"> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + <h2>{{ partial "PrepareHTML" $title }}</h2> </div> {{ end -}} {{- with .image -}} - {{/* TODO: refactor */}} - {{- $image := partial "GetMedia" .file -}} - {{- $url := $image.url -}} - {{- if site.Params.keycdn -}} - {{- $url = $image.direct_url -}} - {{- end -}} - - {{- $lightbox_sizes := "2048x3640" -}} - <figure> + <figure class="{{ $image_class }}"> <a class="glightbox" - data-glightbox="type: image;" - href="{{ partial "GetImageUrl" (dict "url" $url "size" $lightbox_sizes ) }}" + data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" + href="{{- partial "GetLightboxUrl" . -}}" title="{{- i18n "commons.lightbox.link.title" -}}" > {{ partial "commons/image.html" @@ -41,7 +35,7 @@ </a> <figcaption> {{- if $text }} - <p>{{ partial "PrepareHTML" $text }}</p> + {{ partial "PrepareHTML" $text }} {{ end -}} {{- if partial "PrepareHTML" .credit }} <div class="credit">{{ partial "PrepareHTML" .credit }}</div> diff --git a/layouts/partials/blocks/templates/key_figures.html b/layouts/partials/blocks/templates/key_figures.html index 993d47bef2c81b278b0986b31a8c3d72bfbc766f..af8f12e60351c8ef9daccb6ac9a4accc5f12b17f 100644 --- a/layouts/partials/blocks/templates/key_figures.html +++ b/layouts/partials/blocks/templates/key_figures.html @@ -1,4 +1,4 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- $figures := .figures}} @@ -8,10 +8,11 @@ <div class="block-content"> {{- if (or $title .description) }} <div class="top"> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} + <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ end -}} {{- if .description }} <div class="description"> {{ partial "PrepareHTML" .description }} diff --git a/layouts/partials/blocks/templates/organization_chart.html b/layouts/partials/blocks/templates/organization_chart.html index 8258d85a74cb6413cdc7e13465edde3f8548a0be..a515fd200b1c316fb6ab9e9321455b1266766d36 100644 --- a/layouts/partials/blocks/templates/organization_chart.html +++ b/layouts/partials/blocks/templates/organization_chart.html @@ -1,4 +1,4 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- with .block.data -}} @@ -9,10 +9,11 @@ <div class="block-content"> {{ if (or $title .description) -}} <div class="top"> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} + <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ end -}} {{- if .description }} <div class="description"> {{ partial "PrepareHTML" .description }} @@ -25,7 +26,7 @@ {{ $person := site.GetPage (printf "/persons/%s" .slug) }} <article class="person" itemscope itemtype="https://schema.org/Person"> <div class="description"> - <h1 class="name" itemprop="name"> + <h3 class="name" itemprop="name"> {{ if $with_link }} <a href="{{ $person.Permalink }}" aria-label="{{ i18n "commons.more_aria" (dict "Title" $person.Title) }}"> {{ end }} @@ -33,7 +34,7 @@ {{ if $with_link }} </a> {{ end }} - </h1> + </h3> <p itemprop="jobTitle"> {{- if (partial "GetTextFromHTML" .role) }} {{ partial "PrepareHTML" .role }} @@ -48,10 +49,10 @@ <div class="avatar" itemprop="image"> {{- if $person.Params.image }} {{ partial "commons/image.html" - (dict - "image" $person.Params.image - "sizes" site.Params.image_sizes.blocks.organization_chart - )}} + (dict + "image" $person.Params.image + "sizes" site.Params.image_sizes.blocks.organization_chart + )}} {{ end -}} </div> {{ end -}} diff --git a/layouts/partials/blocks/templates/pages.html b/layouts/partials/blocks/templates/pages.html index 83bd699e6ae373f5d56b137819df8c9047e08297..33dbefd8e83b39bb5d307b2419e407829b154cb6 100644 --- a/layouts/partials/blocks/templates/pages.html +++ b/layouts/partials/blocks/templates/pages.html @@ -1,4 +1,4 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- $class := "block block-pages" -}} @@ -53,15 +53,14 @@ <section class="block block-pages{{ if $title }} block-with-title{{ end }} {{ $layout_class }} {{ $page_class }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> - {{- if $title }} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} <div class="top"> - {{/* Quand le bloc a un titre, est-ce qu'on prend le titre de la page principale ou le titre du bloc ? */}} - {{ partial "blocks/title" (dict + {{ partial "blocks/title_with_link.html" (dict "title" $title - "context" $context "link" $page_link ) }} - {{ if and $show_main_description (ne $layout "list")}} {{- with $page }} <p class="description">{{- $main_description -}}</p> diff --git a/layouts/partials/blocks/templates/pages/cards.html b/layouts/partials/blocks/templates/pages/cards.html index 3dc759281c2e75c0339fc6177b755ede0041af77..f6bf4e3bc28f8e6363842d9f6314324bb3a0e809 100644 --- a/layouts/partials/blocks/templates/pages/cards.html +++ b/layouts/partials/blocks/templates/pages/cards.html @@ -10,11 +10,11 @@ {{- end -}} {{ with $page }} <article class="card"> - <h1> + <h3> <a href="{{- .Permalink -}}"> {{- partial "PrepareHTML" .Title -}} </a> - </h1> + </h3> {{ if and $show_descriptions .Params.summary }} {{ if site.Params.pages.index.truncate_description }} diff --git a/layouts/partials/blocks/templates/pages/grid.html b/layouts/partials/blocks/templates/pages/grid.html index 4aefaa7586a686e4d0529fb2e47f89cfa355588f..fd28a25a403dea8157e9582023d2319389e4eb3c 100644 --- a/layouts/partials/blocks/templates/pages/grid.html +++ b/layouts/partials/blocks/templates/pages/grid.html @@ -19,11 +19,11 @@ {{ with $page }} <article> - <h1> + <h3> <a href="{{- .Permalink -}}"> {{- partial "PrepareHTML" .Title -}} </a> - </h1> + </h3> {{ if and $show_descriptions .Params.summary }} {{ if site.Params.pages.index.truncate_description }} <p>{{ partial "GetTruncateContent" ( dict diff --git a/layouts/partials/blocks/templates/partners.html b/layouts/partials/blocks/templates/partners.html index 34034755bc6d7a4269148c5281f72a490e20c7ac..20ce1f6c01183be94956f2b12f22242848de2fe3 100644 --- a/layouts/partials/blocks/templates/partners.html +++ b/layouts/partials/blocks/templates/partners.html @@ -1,4 +1,4 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- with .block.data -}} @@ -7,11 +7,10 @@ <div class="block-content"> {{ if (or $title .description) -}} <div class="top"> - {{- if $title }} - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} + <h2>{{ partial "PrepareHTML" $title }}</h2> {{ end -}} {{- if .description }} <div class="description"> @@ -34,7 +33,7 @@ {{ if .name }} <div> {{ $title = partial "PrepareHTML" .name -}} - <h1> + <h3> {{- if .url }} <a href="{{ .url }}" title="{{ safeHTML (i18n "commons.link.blank_aria" (dict "Title" $title)) }}"> {{ end }} @@ -42,7 +41,7 @@ {{ if .url }} </a> {{ end -}} - </h1> + </h3> </div> {{ end -}} <div class="media"> diff --git a/layouts/partials/blocks/templates/posts.html b/layouts/partials/blocks/templates/posts.html index 67de4bd4dea24887db5816bd1ce813366ecdbb09..89509900b746ce775a1977a30950d64da3e942cd 100644 --- a/layouts/partials/blocks/templates/posts.html +++ b/layouts/partials/blocks/templates/posts.html @@ -1,4 +1,4 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- $term := false -}} @@ -20,11 +20,14 @@ {{ $title_link = $term.Permalink }} {{ end -}} - {{ partial "blocks/title" (dict - "title" $title - "context" $context - "link" $title_link - ) }} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} + {{ partial "blocks/title_with_link.html" (dict + "title" $title + "link" $title_link + ) }} + {{ end -}} </div> {{- end }} diff --git a/layouts/partials/blocks/templates/posts/grid.html b/layouts/partials/blocks/templates/posts/grid.html index 681e236b486f8ff0cd01bf042c17aeaa7ed5223c..5bcf393c86a06160699fc590f92c207089d31238 100644 --- a/layouts/partials/blocks/templates/posts/grid.html +++ b/layouts/partials/blocks/templates/posts/grid.html @@ -1,7 +1,10 @@ <div class="grid"> {{ range $post := .posts -}} {{ with site.GetPage (printf "/posts/%s" $post) }} - {{ partial "posts/post" . }} + {{ partial "posts/post.html" (dict + "post" . + "heading" "h3" + ) }} {{ end }} {{ end }} </div> \ No newline at end of file diff --git a/layouts/partials/blocks/templates/posts/highlight.html b/layouts/partials/blocks/templates/posts/highlight.html index 6c3369909d8f34ca859e0a85bb4cb153036da4b9..aea4626d2e2c380278d141e8f9ea1bc3dd6b3284 100644 --- a/layouts/partials/blocks/templates/posts/highlight.html +++ b/layouts/partials/blocks/templates/posts/highlight.html @@ -6,7 +6,10 @@ {{ with $highlight }} <div class="highlight-post"> - {{ partial "posts/post" . }} + {{ partial "posts/post" (dict + "post" . + "heading" "h3" + ) }} </div> {{ end }} @@ -17,7 +20,7 @@ {{ with site.GetPage (printf "/posts/%s" .) }} <article class="post"> {{- $title := partial "PrepareHTML" .Title -}} - <h1 itemprop="headline"><a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a></h1> + <h3 itemprop="headline"><a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a></h3> {{ if site.Params.posts.index.show_categories }} {{- partial "posts/categories" . -}} {{ end }} diff --git a/layouts/partials/blocks/templates/posts/list.html b/layouts/partials/blocks/templates/posts/list.html index ac8dbb0e4cf2f6b1516a592bdbf770fddb1858eb..9ee54456ab7b5fb7aed483d6f544d4e5bf56eaa4 100644 --- a/layouts/partials/blocks/templates/posts/list.html +++ b/layouts/partials/blocks/templates/posts/list.html @@ -1,7 +1,7 @@ <div class="list"> {{ range $post := .posts -}} {{ with site.GetPage (printf "/posts/%s" $post) }} - {{ partial "posts/post" . }} + {{ partial "posts/post.html" (dict "post" . ) }} {{ end }} {{ end }} </div> \ No newline at end of file diff --git a/layouts/partials/blocks/templates/programs.html b/layouts/partials/blocks/templates/programs.html index b11032074acdda55ed81f6d16b1b588f4fef0c51..377ffdae59bf69ded61d67157ed30f79ebbe586b 100644 --- a/layouts/partials/blocks/templates/programs.html +++ b/layouts/partials/blocks/templates/programs.html @@ -1,16 +1,15 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- with .block.data -}} <section class="block block-programs{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> - {{ if $title -}} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} <div class="top"> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + <h2>{{ partial "PrepareHTML" $title }}</h2> </div> {{ end -}} diff --git a/layouts/partials/blocks/templates/testimonials.html b/layouts/partials/blocks/templates/testimonials.html index 969cc72849e70b8dab4dce0bffc969e5bfbfa861..31e9be932e0592ed235dbe913f2dc4ad45d5bcc1 100644 --- a/layouts/partials/blocks/templates/testimonials.html +++ b/layouts/partials/blocks/templates/testimonials.html @@ -1,4 +1,4 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- $is_carousel := false -}} @@ -10,13 +10,10 @@ <section class="block block-testimonials{{ if $title }} block-with-title{{ end }}{{ if $is_carousel}} with-carousel{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> - {{ if $title -}} - <div class="top"> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} - </div> + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} + <h2 class="hidden">{{ partial "PrepareHTML" $title }}</h2> {{ end -}} <div class="testimonials"> diff --git a/layouts/partials/blocks/templates/timeline.html b/layouts/partials/blocks/templates/timeline.html index a66546ecb8dad079dccb4485753ff0d0ed1709ec..aee968cdf4e64ad4eb7ed6e2fb377237c94b2322 100644 --- a/layouts/partials/blocks/templates/timeline.html +++ b/layouts/partials/blocks/templates/timeline.html @@ -1,4 +1,4 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- $layout := .block.data.layout | default "vertical" -}} @@ -8,7 +8,7 @@ {{ partial $template (dict "title" $title "block" .block - "context" $context + "template" $template ) }} </div> </section> diff --git a/layouts/partials/blocks/templates/timeline/horizontal.html b/layouts/partials/blocks/templates/timeline/horizontal.html index b2eea88c8088aca0c7eed5ab1f23113a574aea75..b10651f7bc40f96dd379736fd028c34e4392d31d 100644 --- a/layouts/partials/blocks/templates/timeline/horizontal.html +++ b/layouts/partials/blocks/templates/timeline/horizontal.html @@ -1,10 +1,9 @@ <div class="timeline"> - {{ if .title }} - {{ partial "blocks/title" (dict - "title" .title - "context" .context - ) }} - {{ end }} + {{- if not .title -}} + {{ partial "blocks/default_title.html" .template }} + {{ else }} + <h2>{{ partial "PrepareHTML" .title }}</h2> + {{ end -}} {{ with .block.data }} <div class="events"> diff --git a/layouts/partials/blocks/templates/timeline/vertical.html b/layouts/partials/blocks/templates/timeline/vertical.html index fd407d64d100ed9b4e57238a141c3a59fea90dd8..0d465e692ebc4f1141ccba0419a1a2aa52a4cddb 100644 --- a/layouts/partials/blocks/templates/timeline/vertical.html +++ b/layouts/partials/blocks/templates/timeline/vertical.html @@ -1,19 +1,18 @@ <div class="block-content"> - {{ if .title -}} + {{- if not .title -}} + {{ partial "blocks/default_title.html" .template }} + {{ else }} <div class="top"> - {{ partial "blocks/title" (dict - "title" .title - "context" .context - ) }} + <h2>{{ partial "PrepareHTML" .title }}</h2> </div> - {{- end }} + {{ end -}} {{ with .block.data -}} <div class="events"> {{ range .events -}} <article class="event"> {{ if .title }} - <h1 class="event-title">{{ partial "PrepareHTML" .title }}</h1> + <h3 class="event-title">{{ partial "PrepareHTML" .title }}</h3> {{ end }} {{ if .text }} <p>{{ partial "PrepareText" .text }}</p> diff --git a/layouts/partials/blocks/templates/video.html b/layouts/partials/blocks/templates/video.html index 9b619e2d6165fe9b8eb5805c6f43f6961aeeaa85..30ecaf0901587ef6ff68858c61718b0c28756198 100644 --- a/layouts/partials/blocks/templates/video.html +++ b/layouts/partials/blocks/templates/video.html @@ -1,17 +1,17 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} +{{/* TODO A11Y: vérifier d'ajouter toujours un titre adjacent à la vidéo */}} {{- with .block.data -}} <section class="block block-video{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> <div> - {{ if $title -}} + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} <div class="top"> - {{ partial "blocks/title" (dict - "title" $title - "context" $context - ) }} + <h2>{{ partial "PrepareHTML" $title }}</h2> </div> {{ end -}} diff --git a/layouts/partials/blocks/title.html b/layouts/partials/blocks/title.html deleted file mode 100644 index 9169f387da5c570e53cc376e3821233fc9914dc4..0000000000000000000000000000000000000000 --- a/layouts/partials/blocks/title.html +++ /dev/null @@ -1,23 +0,0 @@ -{{- if .title }} - {{- if ne .context.Type "programs" }} - <h2> - {{- if .link -}} - <a href="{{ .link }}"> - {{- end -}} - {{ partial "PrepareHTML" .title }} - {{- if .link -}} - </a> - {{- end -}} - </h2> - {{ else }} - <h3> - {{- if .link -}} - <a href="{{ .link }}"> - {{- end -}} - {{ partial "PrepareHTML" .title }} - {{- if .link -}} - </a> - {{- end -}} - </h3> - {{ end -}} -{{ end -}} \ No newline at end of file diff --git a/layouts/partials/blocks/title_with_link.html b/layouts/partials/blocks/title_with_link.html new file mode 100644 index 0000000000000000000000000000000000000000..6fd35b2f80587fe0af8d62d0c0fa845fd1ee3622 --- /dev/null +++ b/layouts/partials/blocks/title_with_link.html @@ -0,0 +1,11 @@ +{{- if .title }} + <h2> + {{- if .link -}} + <a href="{{ .link }}"> + {{- end -}} + {{ partial "PrepareHTML" .title }} + {{- if .link -}} + </a> + {{- end -}} + </h2> +{{ end -}} \ No newline at end of file diff --git a/layouts/partials/organizations/organization.html b/layouts/partials/organizations/organization.html index e434c3d8633d8fbf5dcbf541bf5d8dae7a6a5bcb..a82c6cc2991269d6327df5c96d3137d61d2d24e0 100644 --- a/layouts/partials/organizations/organization.html +++ b/layouts/partials/organizations/organization.html @@ -1,7 +1,7 @@ <article class="organization"> <div> {{ $title := partial "PrepareHTML" .Title }} - <h1><a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a></h1> + <h2><a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a></h2> </div> <div class="media"> {{- if .Params.logo -}} diff --git a/layouts/partials/persons/posts.html b/layouts/partials/persons/posts.html index fbc71b4115014871f3c3f4d86ff45dcba04a85fb..d31f1bf3966e345ed754aae10f168c40e0aaafa4 100644 --- a/layouts/partials/persons/posts.html +++ b/layouts/partials/persons/posts.html @@ -4,7 +4,7 @@ </div> <div class="posts posts--{{- site.Params.posts.index.layout -}}"> {{ range first 3 .Pages }} - {{ partial "posts/post.html" . }} + {{ partial "posts/post.html" (dict "post" . ) }} {{ end }} </div> </section> diff --git a/layouts/partials/posts/block-posts-layout.html b/layouts/partials/posts/block-posts-layout.html index 24a46ee469fee178fce5886846405bac732d2f6f..118aa04ad1a7c47b827a5bd91ec4275c15ce994f 100644 --- a/layouts/partials/posts/block-posts-layout.html +++ b/layouts/partials/posts/block-posts-layout.html @@ -4,7 +4,7 @@ <div class="block-content"> <div class="{{ $layout }}"> {{ range .posts }} - {{ partial "posts/post" . }} + {{ partial "posts/post.html" (dict "post" . ) }} {{ end }} </div> </div> diff --git a/layouts/partials/posts/post.html b/layouts/partials/posts/post.html index ea01cfd3f577cd5f2b8b1f831f925984ca5f5adf..10cdc4cb563b993e03bf929606d4cc6953992840 100644 --- a/layouts/partials/posts/post.html +++ b/layouts/partials/posts/post.html @@ -1,7 +1,19 @@ +{{ $post := .post }} +{{ $heading := .heading | default "h2" }} +{{ $heading_tag := (dict + "open" ((printf "<%s itemprop='headline'>" $heading) | safeHTML) + "close" ((printf "</%s>" $heading) | safeHTML) + ) }} + +{{ with $post }} <article class="post" itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting"> <div class="post-content"> {{- $title := partial "PrepareHTML" .Title -}} - <h1 itemprop="headline"><a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a></h1> + + {{ $heading_tag.open }} + <a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a> + {{ $heading_tag.close }} + {{ if $.Site.Params.posts.index.show_categories }} {{- partial "posts/categories" . -}} {{ end }} @@ -30,3 +42,4 @@ {{- end -}} </div> </article> +{{ end }} \ No newline at end of file diff --git a/layouts/partials/posts/posts.html b/layouts/partials/posts/posts.html index 0dd9340c6dde4de13fcac1b4beda6444411d764f..f3304c7f7a74ba95a78647d0ef7233213b13e7bc 100644 --- a/layouts/partials/posts/posts.html +++ b/layouts/partials/posts/posts.html @@ -3,6 +3,6 @@ <p>{{ i18n "categories.no_post" }}</p> {{ end }} {{ range .Paginator.Pages }} - {{ partial "posts/post.html" . }} + {{ partial "posts/post.html" (dict "post" . )}} {{ end }} </div> diff --git a/layouts/partials/programs/program.html b/layouts/partials/programs/program.html index 45e780431772043dd71f792a40f84b8fa894ff55..caa4fd805e6724997644b30253e191658b4eb909 100644 --- a/layouts/partials/programs/program.html +++ b/layouts/partials/programs/program.html @@ -1,11 +1,11 @@ {{- $title := partial "PrepareHTML" .Title -}} <article class="program"> <div> - <h1> + <h2> <a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}"> {{- $title -}} </a> - </h1> + </h2> {{ if (partial "GetTextFromHTML" .Params.presentation) }} <p>{{- partial "PrepareHTML" .Params.presentation -}}</p> {{ end }}