From 96afe14b25c1ad29ce3f209adc7f8281a4044b4e Mon Sep 17 00:00:00 2001 From: claraRigo <clararigaud0@gmail.com> Date: Tue, 5 Mar 2024 16:02:48 +0100 Subject: [PATCH] Edits apres retours Alex --- assets/sass/_theme/blocks/programs.sass | 28 +++++++++++-------- config.yaml | 4 +++ .../partials/blocks/templates/programs.html | 26 ++++++++--------- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/assets/sass/_theme/blocks/programs.sass b/assets/sass/_theme/blocks/programs.sass index 6fced4f8..9d45697c 100644 --- a/assets/sass/_theme/blocks/programs.sass +++ b/assets/sass/_theme/blocks/programs.sass @@ -26,21 +26,27 @@ @include grid(3, xl) article display: flex - flex-direction: column-reverse + flex-direction: column margin-bottom: $spacing-5 - @include media-breakpoint-up(xl) margin-bottom: 0 @include in-page-without-sidebar margin-bottom: 0 - h3 - margin-bottom: $spacing-2 - @include media-breakpoint-up(desktop) - margin-bottom: 0 - a - text-decoration: none - .more - @include icon(arrow-right, after, true) - margin-top: $spacing-2 + + .program-content + order: 2 + &-title + margin-bottom: $spacing-2 + @include media-breakpoint-up(desktop) + margin-bottom: 0 + + &-details + a + text-decoration: none + .more + @include icon(arrow-right, after, true) + margin-top: $spacing-2 + .media + order: 1 margin-bottom: $spacing-2 \ No newline at end of file diff --git a/config.yaml b/config.yaml index 7540ffe1..e49db55f 100644 --- a/config.yaml +++ b/config.yaml @@ -168,6 +168,10 @@ params: mobile: 170 tablet: 350 desktop: 415 + programs: + mobile: 400 + tablet: 800 + desktop: 600 sections: categories: hero: diff --git a/layouts/partials/blocks/templates/programs.html b/layouts/partials/blocks/templates/programs.html index 7a18c413..91fb66ce 100644 --- a/layouts/partials/blocks/templates/programs.html +++ b/layouts/partials/blocks/templates/programs.html @@ -2,7 +2,7 @@ {{- $block_class := partial "GetBlockClass" .block -}} {{ $heading := .heading | default "h3" }} {{ $heading_tag := (dict - "open" ((printf "<%s itemprop='headline'>" $heading) | safeHTML) + "open" ((printf "<%s class='program-content-title' itemprop='name'>" $heading) | safeHTML) "close" ((printf "</%s>" $heading) | safeHTML) ) }} @@ -20,11 +20,11 @@ {{ $program := site.GetPage (printf "/programs%s" .path) }} {{- $title := partial "PrepareHTML" $program.Title -}} {{- $summary := partial "PrepareHTML" $program.Params.summary -}} - <article> + <article itemscope itemtype="https://schema.org/EducationalOccupationalProgram"> <div class="program-content"> - {{ $heading_tag.open }}{{- $title -}}{{ $heading_tag.close }} - <div> - <p> + {{ $heading_tag.open }}{{- $title -}}{{ $heading_tag.close }} + <div class="program-content-details"> + <p itemprop="abstract"> {{ $summary }} </p> <a href="{{ $program.Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}"> @@ -32,17 +32,15 @@ </a> </div> </div> + {{- if $program.Params.image -}} <div class="media"> - {{- if $program.Params.image -}} - {{- partial "commons/image.html" - (dict - "image" $program.Params.image - "sizes" site.Params.image_sizes.sections.posts.item - ) -}} - {{- else -}} - {{- partial "commons/image-default.html" "posts" -}} - {{- end -}} + {{- partial "commons/image.html" + (dict + "image" $program.Params.image + "sizes" site.Params.image_sizes.blocks.programs + ) -}} </div> + {{- end -}} </article> {{ end }} </div> -- GitLab