diff --git a/assets/sass/_theme/blocks/gallery.sass b/assets/sass/_theme/blocks/gallery.sass index f47364d586b02a598c63b73bd4f47e852b5ede68..402127127a2a3f1c7d9e4bcf18766ad29085b821 100644 --- a/assets/sass/_theme/blocks/gallery.sass +++ b/assets/sass/_theme/blocks/gallery.sass @@ -48,6 +48,8 @@ overflow: hidden padding-bottom: $grid-gutter padding-top: $grid-gutter + position: relative + z-index: 0 @include in-page-without-sidebar background: $block-gallery-carousel-background .block-gallery + &, diff --git a/assets/sass/_theme/blocks/testimonials.sass b/assets/sass/_theme/blocks/testimonials.sass index a70490a7aac0f516dbc36b6f3a1de6399c72d519..d8463ae095e51610b47c47c82150bd10b3665b7d 100644 --- a/assets/sass/_theme/blocks/testimonials.sass +++ b/assets/sass/_theme/blocks/testimonials.sass @@ -17,13 +17,6 @@ @include media-breakpoint-up(xl) font-size: $block-testimonials-xl-font-size-long-text line-height: $block-testimonials-xl-line-height-long-text - // &::before - // content: "“" - // font-size: calc(#{$block-testimonials-font-size} * 3) - // line-height: 1 - // position: absolute - // transform: translateY(-50%) - // TODO : ajuster en fonction de la typo figure margin-bottom: 0 @@ -41,7 +34,6 @@ margin-bottom: 0 @include media-breakpoint-up(desktop) margin-right: calc(#{$grid-gutter} / 2) - // width: calc(#{col(1, 7)} + #{$grid-gutter} / 2) .splide display: flex @@ -102,11 +94,12 @@ .splide__autoplay margin-right: offset(1) figure - padding-left: offset(2) - padding-right: offset(1) + padding-right: offset(3) // TODO: explain this, add min height equal with 2 cols width to avoid overflow on square picture min-height: calc(#{col-outside-container(2)} + #{half($grid-gutter)}) &.with-picture + padding-right: offset(1) + padding-left: offset(2) position: relative figcaption display: block diff --git a/assets/sass/_theme/sections/posts.sass b/assets/sass/_theme/sections/posts.sass index 8daf1905189df683253b70b5c5e423f75550cda3..48a556b9ba4a3130037e71b98b4a9fa67c5530eb 100644 --- a/assets/sass/_theme/sections/posts.sass +++ b/assets/sass/_theme/sections/posts.sass @@ -16,7 +16,6 @@ li margin: 0 - .posts__section, .authors__term, .categories__term, diff --git a/assets/sass/_theme/sections/programs.sass b/assets/sass/_theme/sections/programs.sass index 0fa4bf10a6d88e46351cfb6db5df19319215c1d9..7349338b573f92b4a251aff53382b7535b972d72 100644 --- a/assets/sass/_theme/sections/programs.sass +++ b/assets/sass/_theme/sections/programs.sass @@ -133,7 +133,7 @@ ol.programs $sticky-top-offset: 90px @include sticky($sticky-top-offset) top: $sticky-top-offset - margin-top: -0.3em + // margin-top: -0.3em align-self: start grid-column: 1/5 margin-bottom: 0 @@ -149,9 +149,6 @@ ol.programs line-height: 160% &:first-child border-top: 1px solid $color-border - th, - td - padding: 1rem 0 &:last-child border-bottom: 1px solid $color-border th @@ -202,4 +199,11 @@ ol.programs a p @include small - \ No newline at end of file + .related-posts + .category-link + display: block + text-decoration: none + @include icon(arrow, after, true) + @include hover-translate-icon + @include media-breakpoint-down(desktop) + margin-bottom: $spacing1 \ No newline at end of file diff --git a/config.yaml b/config.yaml index e6263c642bfef35a5e168199d5f3c1d8e8ae31bc..a0776aed41b846e839a804df6595447fe8778c37 100644 --- a/config.yaml +++ b/config.yaml @@ -8,6 +8,7 @@ params: list: show_categories: false truncate_description: 200 # Set to 0 to disable truncate + layout: list # grid | list pages: list: truncate_description: 200 # Set to 0 to disable truncate diff --git a/i18n/en.yml b/i18n/en.yml index d7f0d7ba3fa2d808aae61d4b03b411ef9e00b693..e9eebe244869d11e85137ee9072a664ea3005a89 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -123,7 +123,8 @@ posts: previous: Previous article previous_aria: revious article “{{ .Title }}†see_all: See all posts - see_all_in_category: See all posts in “{{ .Title }}†+ see_all_in_program: See all program's news + see_all_in_category: See all news in “{{ .Title }}†share: Please, share share_aria: Share on “{{ .Title }}†- extern link title: News @@ -158,6 +159,7 @@ programs: essential: Essential pedagogy: Pedagogy presentation: Presentation + related: News results: After the program type: apprenticeship: Apprenticeship diff --git a/i18n/fr.yml b/i18n/fr.yml index 714b5380953f1857f3b3c19ddb258abe57bcc932..b685c5ca17a518b9337d59a3ace7ff2469fc448f 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -123,6 +123,7 @@ posts: previous: Article précédent previous_aria: Article précédent “{{ .Title }}†see_all: Voir toutes les actualités + see_all_in_program: Voir toutes les actualités de la formation see_all_in_category: Voir toutes les actualités “{{ .Title }}†share: Partager sur share_aria: Partager sur “{{ .Title }}†- lien externe @@ -158,6 +159,7 @@ programs: essential: Essentiel pedagogy: Pédagogie presentation: Présentation + related: Actualités results: Après la formation type: apprenticeship: Apprentissage diff --git a/layouts/partials/posts/block-posts-layout.html b/layouts/partials/posts/block-posts-layout.html new file mode 100644 index 0000000000000000000000000000000000000000..195e1fc31602278540268e911b96f89a681db422 --- /dev/null +++ b/layouts/partials/posts/block-posts-layout.html @@ -0,0 +1,12 @@ +{{ $layout := site.Params.posts.list.layout | default "list" }} +<div class="block-posts block-posts--{{- $layout -}}"> + <div class="container"> + <div class="block-content"> + <div class="{{ $layout }}"> + {{ range .posts }} + {{ partial "posts/post" . }} + {{ end }} + </div> + </div> + </div> +</div> \ No newline at end of file diff --git a/layouts/partials/posts/related.html b/layouts/partials/posts/related.html deleted file mode 100644 index 633b5009788d01c682fed82fc1255307492cc72a..0000000000000000000000000000000000000000 --- a/layouts/partials/posts/related.html +++ /dev/null @@ -1,18 +0,0 @@ -{{ if .Pages }} -<section class="related"> - <div class="top"> - <h2 id="page-posts">{{ i18n "posts.title" }}</h2> - <a href="{{ .Permalink }}" class="link"> - {{ $category_name := safeHTML .Title | truncate 30 }} - {{ i18n "posts.see_all_in_category" (dict "Title" $category_name) }} - </a> - </div> - <div class="posts"> - {{ range first 2 .Pages }} - <div> - {{ partial "posts/post.html" . }} - </div> - {{ end }} - </div> -</section> -{{ end }} diff --git a/layouts/partials/programs/related.html b/layouts/partials/programs/related.html new file mode 100644 index 0000000000000000000000000000000000000000..22f9efa21b8c2ea71f3c18f03b8027e92a791097 --- /dev/null +++ b/layouts/partials/programs/related.html @@ -0,0 +1,16 @@ +{{ if .Pages }} +<section class="related-posts" id="{{ urlize (i18n "programs.toc.related") }}"> + <div class="container"> + <div class="content"> + <h2 id="page-posts">{{ i18n "posts.title" }}</h2> + <a href="{{ .Permalink }}" class="category-link"> + {{ $category_name := safeHTML .Title | truncate 30 }} + {{ i18n "posts.see_all_in_program" (dict "Title" $category_name) }} + </a> + <div class="blocks"> + {{ partial "posts/block-posts-layout.html" (dict "posts" .Pages) }} + </div> + </div> + </div> +</section> +{{ end }} diff --git a/layouts/partials/programs/single.html b/layouts/partials/programs/single.html index d221bf94ebe913fbbf704a4e305f456840dc85a8..2f00aa72b95f95ebffad72b86fad1f61a041be26 100644 --- a/layouts/partials/programs/single.html +++ b/layouts/partials/programs/single.html @@ -36,9 +36,8 @@ {{- partial "programs/results.html" . -}} {{- partial "programs/admission.html" . -}} - {{/* TODO: fixer les posts liés */}} - {{/* {{- $category := site.GetPage (printf "/categories%s" .Params.category) -}} */}} - {{/* {{- partial "posts/related.html" $category -}} */}} + {{- $category := site.GetPage (printf "/categories/%s" .Params.related_category ) -}} + {{- partial "programs/related.html" $category -}} {{- partial "hooks/before-program-end.html" . -}} </div> diff --git a/layouts/partials/programs/toc.html b/layouts/partials/programs/toc.html index a911f2ef72d667a2452f039657e5f27574e7f007..42a04f3a6432fbda54fdb92640d39db13838d21f 100644 --- a/layouts/partials/programs/toc.html +++ b/layouts/partials/programs/toc.html @@ -17,6 +17,9 @@ {{ $roles := .context.Params.roles }} {{ $contacts := partial "GetTextFromHTML" .context.Params.contacts }} +{{ $category := site.GetPage (printf "/categories/%s" .context.Params.related_category ) }} +{{ $related_posts := $category.Pages }} + {{/* nav-link required for toggle active class */}} <nav class="toc" id="nav-toc" aria-label="{{ i18n "commons.toc" }}"> <ol> @@ -98,5 +101,10 @@ </ol> {{ end -}} </li> + {{- if gt (len $related_posts) 0 -}} + <li> + <a href="#{{ urlize (i18n "programs.toc.related") }}">{{ i18n "programs.toc.related" }}</a> + </li> + {{- end -}} </ol> </nav>