diff --git a/assets/js/vendors/carousel.js b/assets/js/vendors/carousel.js index 59d6cf3e6741a841b0b0b093170c51ab1e12dc4e..eb86fbe6aa7f7d8b01292b355ffe465cdad0f369 100644 --- a/assets/js/vendors/carousel.js +++ b/assets/js/vendors/carousel.js @@ -20,42 +20,53 @@ class Carousel { } init () { - var splide = new Splide(this.element).mount(), - toggleButton = splide.root.querySelector('.splide__autoplay'), - stepButtons = splide.root.querySelectorAll('.splide__pagination button'), - elements = splide.root.querySelectorAll('.splide__pagination, .splide__slide'), - autoplay = splide.Components.Autoplay; + this.splide = new Splide(this.element).mount(); + const toggleButton = this.splide.root.querySelector('.splide__autoplay'), + stepButtons = this.splide.root.querySelectorAll('.splide__pagination button'), + elements = this.splide.root.querySelectorAll('.splide__pagination, .splide__slide'), + autoplay = this.splide.Components.Autoplay; + this.listen(); if (toggleButton) { stepButtons.forEach((stepButton) => { stepButton.innerHTML = '<i></i>'; }); - splide.on('autoplay:play', function () { + this.splide.on('autoplay:play', () => { toggleButton.classList.add('is-active'); }); - splide.on('autoplay:playing', function (rate) { - var activeStepButton = splide.root.querySelector('.splide__pagination .is-active i'); + this.splide.on('autoplay:playing', (rate) => { + var activeStepButton = this.splide.root.querySelector('.splide__pagination .is-active i'); activeStepButton.style.width = rate * 100 + '%'; }); - splide.on('autoplay:pause', function () { + this.splide.on('autoplay:pause', () => { toggleButton.classList.remove('is-active'); }); - elements.forEach(function(element) { + elements.forEach(element => { element.addEventListener('click', () => { autoplay.pause(); }) }); - splide.on('drag', function() { + this.splide.on('drag', () => { autoplay.pause(); }); } } + + listen() { + this.splide.on('move', () => { + this.splide.root.classList.add('is-moving') + }); + + this.splide.on('moved', () => { + this.splide.root.classList.remove('is-moving') + }); + } } (function () { diff --git a/assets/sass/_theme/_configuration.sass b/assets/sass/_theme/_configuration.sass index 7f42fa1728ee382b84211d99cf1d10475d7a2058..b0abc58c1a568c5e10a90261b31909fc3be10276 100644 --- a/assets/sass/_theme/_configuration.sass +++ b/assets/sass/_theme/_configuration.sass @@ -191,7 +191,6 @@ $hero-color: $color-text !default $hero-background-color: $color-background-alt !default // Breadcrumb -$breadcrumb-below-h1: false !default // NOT READY YET! $breadcrumb-color: $hero-color !default $breadcrumb-color-active: $hero-color !default $breadcrumb-icon: "caret-right" !default @@ -245,6 +244,7 @@ $toc-line-height: $body-line-height !default $toc-title-font-family: $meta-font-family !default $toc-title-font-size: $meta-size !default $toc-title-font-size-desktop: $meta-size-desktop !default +$toc-sticky-transition: 0.4s // Table $table-head-font-size: $h4-size !default @@ -336,8 +336,6 @@ $article-media-aspect-ratio: 2 !default $post-media-background: $article-media-background !default $post-categories-color: color-contrast($color-text, 20%) !default $post-time-color: $color-text-alt !default -// Layout posts list (ne concerne pas les blocks posts) -$posts-layout-list: true !default // Si layout posts grid (ne concerne pas les blocks posts) $posts-grid-columns: $block-posts-grid-columns !default diff --git a/assets/sass/_theme/_utils.sass b/assets/sass/_theme/_utils.sass index 8a86b7bf470ab874827cab1402d8364d3bbc4f4b..690dca386eb5dc795833ec7469b5aa7a17c66ec5 100644 --- a/assets/sass/_theme/_utils.sass +++ b/assets/sass/_theme/_utils.sass @@ -163,24 +163,18 @@ aspect-ratio: #{$ratio} display: block width: 100% - @supports not (aspect-ratio: 1) - position: relative - &::before - content: '' - padding-top: (1 / $ratio) * 100% - width: 100% - #{$selector} - bottom: 0 - left: 0 - position: absolute - right: 0 - top: 0 + +@mixin handle-svg-fit + picture.is-svg + img + object-fit: contain @mixin article($background: null) position: relative display: flex flex-direction: column .media + @include handle-svg-fit @if $article-media-aspect-ratio @include aspect-ratio($article-media-aspect-ratio, 'img', $background) margin-bottom: $spacing1 @@ -188,9 +182,10 @@ overflow: hidden img object-fit: cover - h1 + h2, h3 @include h3 a + display: block @include stretched-link text-decoration: none p @@ -390,4 +385,12 @@ font-style: $style font-weight: $weight font-display: swap - src: $src \ No newline at end of file + src: $src + + +// Old browsers support + +@mixin browser-under-safari-16 + @media not all and (min-resolution:.001dpcm) + @supports (-webkit-appearance:none) and (display:flow-root) + @content \ No newline at end of file diff --git a/assets/sass/_theme/blocks/base.sass b/assets/sass/_theme/blocks/base.sass index 2669479499655ac7862c51d0761886f804804386..8684df5bf5093f046defcf326427838784d6a702 100644 --- a/assets/sass/_theme/blocks/base.sass +++ b/assets/sass/_theme/blocks/base.sass @@ -2,17 +2,21 @@ 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 + .description - margin-top: $spacing2 + margin-top: $spacing1 + @include media-breakpoint-up(desktop) + margin-top: $spacing2 + h2.hidden + .description + margin-top: 0 // 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/call_to_action.sass b/assets/sass/_theme/blocks/call_to_action.sass index b69dbcd608d593e3c091beb6a08ebeb5c43b6680..f06a53ec3037942f2cbbbad13f57db6f597c0ae0 100644 --- a/assets/sass/_theme/blocks/call_to_action.sass +++ b/assets/sass/_theme/blocks/call_to_action.sass @@ -82,6 +82,7 @@ padding-left: $grid-gutter padding-right: $grid-gutter position: relative + z-index: 2 img width: col(3, 6) margin-bottom: calc(-#{$grid-gutter} + -#{$spacing1}) diff --git a/assets/sass/_theme/blocks/chapter.sass b/assets/sass/_theme/blocks/chapter.sass index e4ebe344b8f69c85a26555d497b502d253abcc10..059d9c45adf26d115f5f967177ed2bc595520d4d 100644 --- a/assets/sass/_theme/blocks/chapter.sass +++ b/assets/sass/_theme/blocks/chapter.sass @@ -5,6 +5,9 @@ margin-top: $spacing1 * @include small + sub, sup + font-size: 60% + margin-left: 0 picture, img display: block figcaption diff --git a/assets/sass/_theme/blocks/definitions.sass b/assets/sass/_theme/blocks/definitions.sass index 9043508e296719d1daac8da9ceb4db9ce9cae388..393a5e7f7259afef050e9b0e4864a8b35bd59b5f 100644 --- a/assets/sass/_theme/blocks/definitions.sass +++ b/assets/sass/_theme/blocks/definitions.sass @@ -9,6 +9,13 @@ justify-content: space-between align-items: center transition: color 0.3s + @include browser-under-safari-16 + position: relative + &::after + display: block + position: absolute + right: 0 + bottom: 10px &:hover color: $block-definition-color-hovered summary, @@ -27,6 +34,8 @@ @include media-breakpoint-up(desktop) @include in-page-without-sidebar .definitions - @include grid(2, desktop) - grid-row-gap: 0 !important + details + p + padding-left: col(4) + margin-left: $grid-gutter diff --git a/assets/sass/_theme/blocks/gallery.sass b/assets/sass/_theme/blocks/gallery.sass index 8e9fa3fe2d14765597ba9c9413cd0366b0d2c805..9a2324a8022a73c5d1569aa0d94a073573c6853d 100644 --- a/assets/sass/_theme/blocks/gallery.sass +++ b/assets/sass/_theme/blocks/gallery.sass @@ -32,7 +32,7 @@ &--grid .gallery - align-items: baseline + align-items: start @include in-page-with-sidebar @include grid(3, desktop, half($grid-gutter), half($grid-gutter)) @include in-page-without-sidebar @@ -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 + &, @@ -61,6 +63,10 @@ .splide display: flex flex-direction: column + @include in-page-with-sidebar + &.is-moving + .splide__slide.is-active + opacity: 0.1 &__track overflow: visible margin-right: half(-$grid-gutter-sm) 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/organization_chart.sass b/assets/sass/_theme/blocks/organization_chart.sass index e13111d17634aca4ec0138dfcffa60abfebb95d2..46a5f3bfb105d3be7ca097e185c8ce26a68fc365 100644 --- a/assets/sass/_theme/blocks/organization_chart.sass +++ b/assets/sass/_theme/blocks/organization_chart.sass @@ -1,33 +1,21 @@ .block-organization_chart - article - position: relative - .name - @include h4 - a - @include stretched-link - text-decoration: none - + p - margin-top: half($spacing0) - + @include media-breakpoint-up(desktop) + @include in-page-without-sidebar + .top .description + max-width: col(8) @include in-page-with-sidebar .persons @include grid(1, sm) @include grid(2, desktop) article flex-direction: row - align-items: start .avatar margin-right: $spacing1 width: calc(#{col(1, 4)} + #{$grid-gutter}) .description - flex: 1 margin-top: $spacing1 @include media-breakpoint-up(sm) @include in-page-without-sidebar .persons @include grid(4, lg) - @include grid(6, xl) - article - text-align: center - .avatar - width: 100% \ No newline at end of file + @include grid(6, xl) \ No newline at end of file diff --git a/assets/sass/_theme/blocks/pages.sass b/assets/sass/_theme/blocks/pages.sass index e4356719f3070640d250c714c77529dac27a9284..851d2b3f590676412d1cff3315d9ff1826301f38 100644 --- a/assets/sass/_theme/blocks/pages.sass +++ b/assets/sass/_theme/blocks/pages.sass @@ -11,6 +11,7 @@ display: flex flex-direction: column .media + @include handle-svg-fit order: -1 margin-bottom: $spacing1 img @@ -18,7 +19,7 @@ aspect-ratio: 16/9 object-fit: cover width: 100% - h1 + h3 @include h3 a text-decoration: none @@ -32,7 +33,7 @@ @include media-breakpoint-down(desktop) .top - h2, h3 + h2 @include h5 .description @include h2 @@ -43,7 +44,7 @@ @include media-breakpoint-up(desktop) .top @include grid - h2, h3 + h2 grid-column: 1 / 5 a text-decoration: none @@ -139,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) @@ -172,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/partners.sass b/assets/sass/_theme/blocks/partners.sass index 00ee86245cf7744721ae630561219b93e2cbe12a..692a80b49e69f180a21d5f1f8e83956aa7df09cb 100644 --- a/assets/sass/_theme/blocks/partners.sass +++ b/assets/sass/_theme/blocks/partners.sass @@ -1,4 +1,8 @@ .block-partners + @include media-breakpoint-up(desktop) + @include in-page-without-sidebar + .top .description + max-width: col(8) @include in-page-with-sidebar .organizations @include grid(4, xl) diff --git a/assets/sass/_theme/blocks/posts.sass b/assets/sass/_theme/blocks/posts.sass index eae9f38c00d515d1dbe4e7dbe20be582de3e9649..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,13 +95,11 @@ margin-top: 0.3em &--highlight .highlight-post - h1 + h3 margin-bottom: $spacing0 .media margin-bottom: $spacing0 background: none - &, img - aspect-ratio: auto .list margin-top: half($spacing3) border-top: 1px solid $color-border @@ -136,7 +127,7 @@ .list article @include grid(8, desktop, 0, 0) - h1 + h3 grid-column: 1 / 7 .post-categories grid-column: 1 / 7 @@ -156,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/sitemap.sass b/assets/sass/_theme/blocks/sitemap.sass new file mode 100644 index 0000000000000000000000000000000000000000..bb45be78dfabbd6cc8eceefc2124610dcf8d940d --- /dev/null +++ b/assets/sass/_theme/blocks/sitemap.sass @@ -0,0 +1,8 @@ +.block-sitemap + h3 + a + text-decoration: none + ul + h3 + margin-top: $spacing3 + &:first-of-type + padding-top: 0 \ No newline at end of file diff --git a/assets/sass/_theme/blocks/chapo.sass b/assets/sass/_theme/blocks/summary.sass similarity index 92% rename from assets/sass/_theme/blocks/chapo.sass rename to assets/sass/_theme/blocks/summary.sass index a5d9f80b138fde53a74be91548bdb26532d1bc7a..ab1305163df496258406b4066995bba47533b7a3 100644 --- a/assets/sass/_theme/blocks/chapo.sass +++ b/assets/sass/_theme/blocks/summary.sass @@ -1,4 +1,4 @@ -.block-chapo +.block-summary @include in-page-without-sidebar padding-top: 0 margin-top: $spacing3 diff --git a/assets/sass/_theme/blocks/testimonials.sass b/assets/sass/_theme/blocks/testimonials.sass index a70490a7aac0f516dbc36b6f3a1de6399c72d519..81b79cb17adcc1c1f9a3cf41e41dc6934a4ab49f 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 @@ -65,6 +57,10 @@ width: 42px &::before color: $color-accent + &:not(.is-active) + + .splide__pagination + .is-active i + width: 100% !important .splide__play &::before @@ -95,26 +91,28 @@ @include media-breakpoint-up(desktop) @include in-page-without-sidebar .top - padding-left: offset(2) + padding-left: offset(3) .splide__pagination - padding-left: offset(2) + padding-left: offset(3) padding-right: offset(1) .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(3) position: relative figcaption display: block margin-top: $spacing0 .avatar position: absolute - left: 0 + left: col(1) top: 0 + margin-left: $grid-gutter width: col(2) // TODO : en discuter en créa 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/blocks/video.sass b/assets/sass/_theme/blocks/video.sass index a0b54ca88c78376de4df61787b406731820cc104..4052c1745aa36aaced47235e3fefa4cdc276b6db 100644 --- a/assets/sass/_theme/blocks/video.sass +++ b/assets/sass/_theme/blocks/video.sass @@ -1,6 +1,9 @@ .block-video .video @include aspect-ratio(16/9, 'iframe') + @supports not (aspect-ratio: 1) + iframe + min-height: 400px iframe background: black @include in-page-without-sidebar diff --git a/assets/sass/_theme/design-system/contacts.sass b/assets/sass/_theme/design-system/contacts.sass new file mode 100644 index 0000000000000000000000000000000000000000..003b3cdb7cdc83d2543db12bb3d471afbb558956 --- /dev/null +++ b/assets/sass/_theme/design-system/contacts.sass @@ -0,0 +1,29 @@ +.contacts-details + margin-top: $spacing3 + ul + @include list-reset + padding-left: 0 + li + list-style-type: none + + li + margin-top: $spacing1 + address + @extend .p + > span + @include meta + display: block + @include media-breakpoint-down(md) + width: auto + ul + ul + margin-top: $spacing1 + li + align-items: baseline + justify-content: space-between + // display: flex + // text-align: right + > span + flex-shrink: 0 + margin-right: $spacing1 + text-align: left + address + text-align: right diff --git a/assets/sass/_theme/design-system/hero.sass b/assets/sass/_theme/design-system/hero.sass index 05d97cf4f5ca566977e2c6713952b042250a6e8a..5162b4768c1b431718d4b73091edf2c75bf17992 100644 --- a/assets/sass/_theme/design-system/hero.sass +++ b/assets/sass/_theme/design-system/hero.sass @@ -19,6 +19,7 @@ padding-top: $spacing3 > h1, > hgroup margin-top: $spacing3 + h1 + p margin-top: $spacing1 figure @@ -30,18 +31,10 @@ height: auto @include collapsed-figcaption - nav + .content + .breadcrumb-nav + .content padding-top: 0 - // TODO : handle hero with image - @if $breadcrumb-below-h1 - .container:first-child - display: flex - flex-direction: column - nav + .content - margin-top: 0 - .breadcrumb-nav - order: 3 - margin-top: $spacing3 + .content + .breadcrumb-nav + margin-top: $spacing3 @include media-breakpoint-down(desktop) .breadcrumb-nav diff --git a/assets/sass/_theme/design-system/layout.sass b/assets/sass/_theme/design-system/layout.sass index 6621ababc35719147c6e7d4880ea7fc164644c1c..61657af0165cfe8ce776540f42cd9ab597d004bd 100644 --- a/assets/sass/_theme/design-system/layout.sass +++ b/assets/sass/_theme/design-system/layout.sass @@ -43,11 +43,17 @@ iframe .hero + & margin-top: $spacing3 +.hidden + display: none + ul, ol // https://since1979.dev/aligning-your-lists-with-your-text/ padding-left: 0 list-style-position: inside + > li + > p + display: inline .document-content .container > .lead diff --git a/assets/sass/_theme/design-system/pagination.sass b/assets/sass/_theme/design-system/pagination.sass index 6a3b229f49e954a3343a6349c052693261f1c730..799cd099db19f092823fc586d19506e42305b874 100644 --- a/assets/sass/_theme/design-system/pagination.sass +++ b/assets/sass/_theme/design-system/pagination.sass @@ -6,6 +6,8 @@ display: flex flex-wrap: wrap margin-top: $spacing3 + main.page-with-blocks & + padding-bottom: $spacing3 li a color: inherit diff --git a/assets/sass/_theme/design-system/table.sass b/assets/sass/_theme/design-system/table.sass index f0411e1aff7603a38352a6bbe77ea42083bac792..98f688dab045b6250508d26acb3b7d2304cfa899 100644 --- a/assets/sass/_theme/design-system/table.sass +++ b/assets/sass/_theme/design-system/table.sass @@ -13,6 +13,9 @@ table padding-top: $spacing0 padding-bottom: $spacing0 padding-right: $spacing0 + @include in-page-with-sidebar + padding-top: calc(#{$spacing0} / 2) + padding-bottom: calc(#{$spacing0} / 2) thead @include h4 diff --git a/assets/sass/_theme/design-system/table_of_contents.sass b/assets/sass/_theme/design-system/table_of_contents.sass index 4d4bb690c4b403fbfffa9b79d64db8a90ba696ac..0e7d1746f0da1b9d126bbdf61f39efd66dd8bb08 100644 --- a/assets/sass/_theme/design-system/table_of_contents.sass +++ b/assets/sass/_theme/design-system/table_of_contents.sass @@ -31,7 +31,6 @@ padding-top: 0 padding-bottom: 0 line-height: calc(var(--header-height) - 1px) - .toc flex: 1 display: flex @@ -74,9 +73,16 @@ display: none @include media-breakpoint-up(desktop) @include container + background: $color-background justify-content: end - text-align: right margin-bottom: $spacing3 + position: sticky + text-align: right + top: calc(var(--header-height) * -1) + transition: top $toc-sticky-transition + z-index: $zindex-toc-cta + html:not(.is-scrolling-down) & + top: var(--header-height) body.offcanvas-toc & display: flex @include media-breakpoint-down(desktop) @@ -180,7 +186,7 @@ display: block text-decoration-color: transparent &:hover - text-decoration: underline + text-decoration-color: $toc-color .active color: $toc-active-color pointer-events: none diff --git a/assets/sass/_theme/hugo-osuny.sass b/assets/sass/_theme/hugo-osuny.sass index 2fb6caef6ec5a0bb9691936f237f00d73407e7b7..6878b684cd7863407d37b590c0f83338e68ab35d 100644 --- a/assets/sass/_theme/hugo-osuny.sass +++ b/assets/sass/_theme/hugo-osuny.sass @@ -19,6 +19,7 @@ @import "design-system/a11y" @import "design-system/breadcrumb" @import "design-system/button" +@import "design-system/contacts" @import "design-system/footer" @import "design-system/header" @import "design-system/hero" @@ -31,7 +32,6 @@ // Blocks @import "blocks/base" -@import "blocks/chapo" @import "blocks/datatable" @import "blocks/call_to_action" @import "blocks/chapter" @@ -47,6 +47,8 @@ @import "blocks/partners" @import "blocks/posts" @import "blocks/programs" +@import "blocks/sitemap" +@import "blocks/summary" @import "blocks/testimonials" @import "blocks/timeline" @import "blocks/video" diff --git a/assets/sass/_theme/sections/organizations.sass b/assets/sass/_theme/sections/organizations.sass index 0c413b93a4bc7e5512a9275ad8003646440150ea..19b8db695408f11ecc135b2b30ebb8a4d8521b01 100644 --- a/assets/sass/_theme/sections/organizations.sass +++ b/assets/sass/_theme/sections/organizations.sass @@ -1,16 +1,18 @@ .organization @include article position: relative - h1 + h2 @include meta a @include stretched-link text-decoration: none .media background: $color-background-alt - aspect-ratio: 1/1 padding: $spacing1 margin-bottom: half($spacing0) + picture + aspect-ratio: 1/1 + display: block img width: 100% height: 100% @@ -35,54 +37,42 @@ margin-top: $spacing2 .organizations__page + .lead + font-family: $lead-sidebar-font-family + font-weight: $lead-sidebar-weight + line-height: $lead-sidebar-line-height + margin-bottom: $spacing1 + @include media-breakpoint-up(desktop) + font-size: $lead-sidebar-size-desktop .document-content - .organization-meta - .logo - figcaption - text-align: right - @include meta - margin-bottom: $spacing0 - picture - aspect-ratio: 1/1 - background: $color-background-alt - display: block - padding: $spacing2 - margin-bottom: half($spacing0) - img - width: 100% - height: 100% - object-fit: contain - object-position: center + .logo + figcaption + text-align: right + @include meta + margin-bottom: $spacing0 + picture + aspect-ratio: 1/1 + background: $color-background-alt + display: block + padding: $spacing2 + margin-bottom: half($spacing0) + width: auto + img + width: 100% + height: 100% + object-fit: contain + object-position: center .blocks margin-top: $spacing3 - .contacts-list - @include list-reset - padding-left: 0 - text-align: right - margin-top: $spacing1 - li - list-style-type: none - + li - margin-top: $spacing1 - span - @include meta - display: block - @include media-breakpoint-down(desktop) + .contacts-details + @include grid(2, md) + @include media-breakpoint-down(md) .document-content - .organization-meta + .logo margin-top: $spacing3 - .logo - display: flex - justify-content: space-between - picture - width: 66.6% - .contacts-list - li - display: flex - justify-content: space-between - align-items: baseline - - @include media-breakpoint-up(desktop) + display: flex + justify-content: space-between + @include media-breakpoint-up(md) .document-content > .container display: flex @@ -90,5 +80,5 @@ gap: $grid-gutter [itemprop="articleBody"] width: col(8) - .organization-meta - width: col(3) \ No newline at end of file + .logo + width: col(3) diff --git a/assets/sass/_theme/sections/persons.sass b/assets/sass/_theme/sections/persons.sass index c9271764965eede08980480d948160ebe8541efe..87709e0f3898dfa940d73c12e5fcfe4be58c4bae 100644 --- a/assets/sass/_theme/sections/persons.sass +++ b/assets/sass/_theme/sections/persons.sass @@ -40,41 +40,44 @@ @include article word-break: break-word .avatar - margin-bottom: $spacing1 + align-self: start + flex-shrink: 0 order: -1 - width: px2rem(76) + margin-bottom: $spacing1 .name - margin-bottom: px2rem(5) - // & ~ p - // @include small - + @include h4 + a + @include stretched-link + text-decoration: none + + p + margin-top: half($spacing0) .description @include small - - @include media-breakpoint-down(desktop) - display: block - &::after - content: '' - clear: both - display: table - > div:first-of-type - float: left - max-width: calc(100% - 6rem) + @include media-breakpoint-down(md) + flex-direction: row + justify-content: space-between .avatar - float: right + align-self: start + flex-shrink: 0 + order: 2 + margin-left: $spacing0 margin-bottom: 0 - + @include media-breakpoint-up(desktop) + @include in-page-without-sidebar + text-align: center + .avatar + width: 100% section.persons, div.persons @include grid(1) @include grid(2, md) @include grid(3, lg) - @include grid(4, xl) - @include grid(5, xxl) + @include grid(5, xl) + @include grid(6, xxl) -ol.persons +ol.persons--list @include list-reset > li border-bottom: 1px solid $color-border @@ -152,6 +155,8 @@ ol.persons .persons__section * + .persons margin-top: $spacing-section-y + .persons:last-child + padding-bottom: $spacing3 .persons__page .hero @@ -179,6 +184,8 @@ ol.persons .roles a @include small + .blocks + margin-top: $spacing3 .person-programs margin-top: $spacing4 @include media-breakpoint-down(lg) @@ -195,4 +202,8 @@ ol.persons text-align: right .lead + div margin-top: $spacing2 - + .contacts-details ul + @include grid(2, md, 0) + li + margin-top: 0 + margin-bottom: $spacing1 diff --git a/assets/sass/_theme/sections/posts.sass b/assets/sass/_theme/sections/posts.sass index fc9b4d18b6351939d2cfce25fbf7454e176d0951..cbf241a8a7dc8909b72717475a7cdc564ac7648e 100644 --- a/assets/sass/_theme/sections/posts.sass +++ b/assets/sass/_theme/sections/posts.sass @@ -16,57 +16,55 @@ li margin: 0 - .posts__section, .authors__term, .categories__term, .persons__page - @if $posts-layout-list - .posts - article - border-bottom: 1px solid $color-border - display: flex - margin-bottom: $spacing1 - padding-bottom: $spacing1 - flex-direction: row - h1 + p - margin-top: $spacing0 - @include media-breakpoint-up(desktop) - @include grid - margin-bottom: $spacing3 - padding-bottom: $spacing3 - div:not(.media) - grid-column: 4/13 - @include media-breakpoint-down(desktop) - flex: 1 - margin-left: $spacing0 - p:not(.title) - @include media-breakpoint-down(desktop) - display: none - .media - background: none - margin: 0 + + .posts--list + article + border-bottom: 1px solid $color-border + display: flex + margin-bottom: $spacing1 + padding-bottom: $spacing1 + flex-direction: row + h2 + p, h3 + p + margin-top: $spacing0 + @include media-breakpoint-up(desktop) + @include grid + margin-bottom: $spacing3 + padding-bottom: $spacing3 + div:not(.media) + grid-column: 4/13 + @include media-breakpoint-down(desktop) + flex: 1 + margin-left: $spacing0 + p:not(.title) @include media-breakpoint-down(desktop) - width: 33.33333% - @include media-breakpoint-up(desktop) - grid-column: 1/4 + display: none + .media + background: none + margin: 0 + @include media-breakpoint-down(desktop) + width: 33.33333% @include media-breakpoint-up(desktop) - time - font-size: $h5-size - position: absolute - right: 0 - top: 0 - div:not(.media) - h1, - p, - a - max-width: col(6, 9) - - @else - .posts - @include grid(1) - @include grid(2, desktop) - @include grid($posts-grid-columns, xxl) + grid-column: 1/4 + &, img + aspect-ratio: auto + @include media-breakpoint-up(desktop) + time + font-size: $h5-size + position: absolute + right: 0 + top: 0 + div:not(.media) + h2, h3, + p + max-width: col(6, 9) + .posts--grid + @include grid(1) + @include grid(2, desktop) + @include grid($posts-grid-columns, xxl) .posts__page @include media-breakpoint-down(desktop) diff --git a/assets/sass/_theme/sections/programs.sass b/assets/sass/_theme/sections/programs.sass index 0fa4bf10a6d88e46351cfb6db5df19319215c1d9..cee274383e3067218ae558e0e20fd35185d16c94 100644 --- a/assets/sass/_theme/sections/programs.sass +++ b/assets/sass/_theme/sections/programs.sass @@ -80,6 +80,7 @@ ol.programs border-radius: px2rem(4) a[download] @include button-icon(download) + text-decoration: none color: $hero-background-color background: $hero-color border-color: $hero-color @@ -102,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 @@ -116,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 @@ -133,7 +136,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 +152,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 +202,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 c338f51b8326132320121bfbc47ecf6057300c90..f926a8e11fe05a84832e11318a2c4517b92a9f61 100644 --- a/config.yaml +++ b/config.yaml @@ -1,29 +1,168 @@ -## ADVANCED -paginate: 18 -enableRobotsTXT: true - -## MODULE -module: - _merge: deep - -removePathAccents: true - params: keycdn: https://osuny-1b4da.kxcdn.com cookie_banner: enable: false blank: true page: https://gdpr.eu/cookies/ + breadcrumb: + position: hero-start # hero-start | hero-end | after-hero posts: - list: + index: show_categories: false truncate_description: 200 # Set to 0 to disable truncate + layout: list # grid | list pages: - list: + index: truncate_description: 200 # Set to 0 to disable truncate + persons: + index: + layout: list # grid | list home: toc: disabled: true logo: header: "/assets/images/logo.svg" - footer: "/assets/images/logo.svg" \ No newline at end of file + footer: "/assets/images/logo.svg" + + image_sizes: + design_system: + lightbox: + # TODO mobile et tablet + mobile: 1920x2560 + tablet: 1920x2560 + desktop: 1920x2560 + hero: + mobile: 400 + tablet: 800 + desktop: 900 + blocks: + call_to_action: + mobile: 164 + tablet: 350 + desktop: 415 + chapter: + mobile: 350 + tablet: 450 + desktop: 1280 + image: + mobile: 480x850 + tablet: 768x1360 + desktop: 1400x1820 + organization_chart: + mobile: 80 + tablet: 100 + desktop: 255 + partners: + mobile: 164 + tablet: 216 + desktop: 196 + testimonials: + desktop: 200 + gallery: + carousel: + mobile: 400 + tablet: 600 + desktop: 1024 + grid: + mobile: 170 + tablet: 350 + desktop: 415 + sections: + categories: + hero: + mobile: 400 + tablet: 800 + desktop: 900 + hero_term: + mobile: 400 + tablet: 800 + desktop: 900 + diplomas: + hero: + mobile: 400 + tablet: 800 + desktop: 900 + hero_single: + mobile: 351 + tablet: 456 + desktop: 856 + home: + hero: + mobile: 400 + tablet: 800 + desktop: 900 + organizations: + hero: + mobile: 400 + tablet: 800 + desktop: 900 + logo: + mobile: 331 + tablet: 196 + desktop: 396 + item: + mobile: 144 + tablet: 196 + desktop: 176 + pages: + hero: + mobile: 400 + tablet: 800 + desktop: 900 + item: + mobile: 350 + tablet: 400 + desktop: 900 + papers: + hero: + mobile: 400 + tablet: 800 + desktop: 900 + hero_single: + mobile: 400 + tablet: 800 + desktop: 900 + persons: + hero: + mobile: 400 + tablet: 800 + desktop: 900 + hero_single: + mobile: 200 + tablet: 200 + desktop: 415 + item: + mobile: 80 + tablet: 100 + desktop: 255 + posts: + hero: + mobile: 400 + tablet: 800 + desktop: 900 + hero_single: + mobile: 400 + tablet: 800 + desktop: 900 + item: + mobile: 350 + tablet: 450 + desktop: 900 + programs: + hero: + mobile: 400 + tablet: 800 + desktop: 900 + image: + mobile: 351x168 + tablet: 456x219 + desktop: 856x410 + volumes: + hero: + mobile: 400 + tablet: 800 + desktop: 900 + item: + mobile: 327x388 + tablet: 208x247 + desktop: 300x356 \ No newline at end of file diff --git a/content/sitemap/_index.en.html b/content/sitemap/_index.en.html deleted file mode 100644 index 0eda955af3947a08420ad5b465e537bcd668334c..0000000000000000000000000000000000000000 --- a/content/sitemap/_index.en.html +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: Sitemap ---- diff --git a/content/sitemap/_index.fr.html b/content/sitemap/_index.fr.html deleted file mode 100644 index 4604f40ad6caaff54b3bc4e0e41c91ac193703ef..0000000000000000000000000000000000000000 --- a/content/sitemap/_index.fr.html +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Plan du site -url: plan-du-site ---- diff --git a/i18n/en.yml b/i18n/en.yml index a3dddf198ddc05c57ace8dd6c586aea992be5415..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: @@ -23,6 +62,7 @@ commons: slideX: Go to slide %s close: Close contact: + address: Address email: Email phone: Téléphone website: Site web @@ -122,7 +162,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 @@ -157,6 +198,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 5c9a41e097161dfc767d0fb846134d64b5f6627f..9ceee926ff0f08284d4204492f0f32d21cde7ae2 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: @@ -23,6 +62,7 @@ commons: slideX: Aller au slide %s close: Fermer contact: + address: Adresse email: Email phone: Téléphone website: Site web @@ -123,6 +163,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 +199,7 @@ programs: essential: Essentiel pedagogy: Pédagogie presentation: Présentation + related: Actualités results: Après la formation type: apprenticeship: Apprentissage @@ -176,8 +218,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/_default/list.html b/layouts/_default/list.html index a89c1e0b33159f7b18c0d806ea7c22ae15c04d62..86145a657c0a16ba8031b134fde643074d0f072f 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -12,7 +12,7 @@ ) }} - {{ partial "pages/chapo.html" (dict + {{ partial "pages/summary.html" (dict "context" . "block_wrapped" true ) }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a89c1e0b33159f7b18c0d806ea7c22ae15c04d62..86145a657c0a16ba8031b134fde643074d0f072f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -12,7 +12,7 @@ ) }} - {{ partial "pages/chapo.html" (dict + {{ partial "pages/summary.html" (dict "context" . "block_wrapped" true ) }} diff --git a/layouts/administrators/list.html b/layouts/administrators/list.html index c9078e727c0e5db7c8d4bcde875a5331ad426bb9..64d780d483a76930c4c1706fe5045d0dc82ef185 100644 --- a/layouts/administrators/list.html +++ b/layouts/administrators/list.html @@ -4,7 +4,7 @@ <div class="document-content"> - {{ partial "persons/chapo.html" (dict + {{ partial "persons/summary.html" (dict "with_container" true "context" . ) }} diff --git a/layouts/authors/list.html b/layouts/authors/list.html index 9cdc369a18f5b4092ac37b69154e73c0b0f0adcd..691bfe546ed6aa2e1f659233cdceecfbf0e136b3 100644 --- a/layouts/authors/list.html +++ b/layouts/authors/list.html @@ -4,7 +4,7 @@ <div class="document-content"> - {{ partial "persons/chapo.html" (dict + {{ partial "persons/summary.html" (dict "with_container" true "context" . ) }} diff --git a/layouts/categories/term.html b/layouts/categories/term.html index 3ad184382b4707c0fb06f9e3fcf4e17b89563a3c..861797356883e6a1ce363513419d332cfcc77281 100644 --- a/layouts/categories/term.html +++ b/layouts/categories/term.html @@ -9,7 +9,7 @@ ) }} - {{ partial "posts/chapo.html" (dict + {{ partial "posts/summary.html" (dict "context" . "block_wrapped" true ) }} diff --git a/layouts/diplomas/list.html b/layouts/diplomas/list.html index 605348df96a5349a50798198974a2fbf1415f5ea..30e8fd0db47843113acb8d668edfac4bbef18c18 100644 --- a/layouts/diplomas/list.html +++ b/layouts/diplomas/list.html @@ -3,7 +3,7 @@ <div class="document-content"> - {{ partial "diplomas/chapo.html" (dict + {{ partial "diplomas/summary.html" (dict "with_container" true "context" . ) }} diff --git a/layouts/index.html b/layouts/index.html index af420fdc051101f8b24337d8527265ffce1aba17..1c7b0e34b339b63c08514e5912ad63ba69e31b97 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -11,7 +11,7 @@ }} {{- end -}} - {{ partial "home/chapo.html" (dict + {{ partial "home/summary.html" (dict "block_wrapped" true "context" . ) }} diff --git a/layouts/organizations/list.html b/layouts/organizations/list.html index c56beb57d6fc1612f5b7a06b0ca41d38dc8e618d..32e04debdd4cc09f1a214a84f7ff90c95710192b 100644 --- a/layouts/organizations/list.html +++ b/layouts/organizations/list.html @@ -1,12 +1,26 @@ {{ define "main" }} + {{- $is_partners_block_present := false -}} + {{ range .Params.blocks }} + {{- if eq .template "partners" -}} + {{- $is_partners_block_present = true -}} + {{ end }} + {{ end }} + {{ partial "organizations/hero.html" . }} <div class="document-content"> + {{ partial "pages/summary.html" (dict + "context" . + "with_container" true + ) }} + + {{ partial "blocks/list.html" . }} + <div class="container"> - {{ partial "organizations/organizations.html" . }} - {{ partial "commons/pagination.html" . }} + {{- if not $is_partners_block_present -}} + {{ partial "organizations/organizations.html" . }} + {{ partial "commons/pagination.html" . }} + {{ end }} </div> - - {{ partial "blocks/list.html" . }} </div> {{ end }} diff --git a/layouts/organizations/single.html b/layouts/organizations/single.html index e2d9ef781b07e0ce21ff0f42a5face0fc4a3ab15..3d6039cfaf3b8514989d77bf7bf5c6764bae6556 100644 --- a/layouts/organizations/single.html +++ b/layouts/organizations/single.html @@ -1,21 +1,29 @@ {{ define "main" }} {{ partial "organizations/hero.html" . }} - <div class="document-content"> + <div class="document-content" itemscope itemtype="https://schema.org/Organization"> - {{ partial "toc/container.html" - (dict - "toc" "toc/default.html" - "context" . - ) - }} + {{ partial "toc/container.html" (dict + "toc" "toc/default.html" + "context" . + ) }} <div class="container"> - {{ partial "organizations/content.html" . }} - <div class="organization-meta"> - {{ partial "organizations/logo.html" . }} - {{ partial "organizations/contacts.html" . }} + <div itemprop="articleBody" class="rich-text"> + {{ partial "pages/summary.html" (dict + "context" . + ) }} + + {{ if (partial "GetTextFromHTML" .Content) }} + {{ partial "PrepareHTML" ( + partial "H2AddId" .Content + ) }} + {{ end }} + + {{ partial "organizations/contact-details.html" . }} + </div> + {{ partial "organizations/logo.html" . }} </div> {{ partial "blocks/list.html" . }} </div> diff --git a/layouts/pages/list.html b/layouts/pages/list.html index a89c1e0b33159f7b18c0d806ea7c22ae15c04d62..7a19eef26b2be4a2647e59ea4bc24361146f739b 100644 --- a/layouts/pages/list.html +++ b/layouts/pages/list.html @@ -12,7 +12,7 @@ ) }} - {{ partial "pages/chapo.html" (dict + {{ partial "pages/summary.html" (dict "context" . "block_wrapped" true ) }} @@ -23,6 +23,7 @@ <section class="block block-pages block-pages--grid"> <div class="container"> <div class="block-content"> + {{- partial "blocks/default_title.html" "pages" -}} {{- partial "blocks/templates/pages/grid.html" (dict "pages" .Params.children "show_images" true diff --git a/layouts/pages/sitemap.html b/layouts/pages/sitemap.html new file mode 100644 index 0000000000000000000000000000000000000000..45fd62f30ec595762f015a4b0082ad116de57e45 --- /dev/null +++ b/layouts/pages/sitemap.html @@ -0,0 +1,45 @@ +{{ define "main" }} + {{- partial "header/hero.html" + (dict + "title" .Title + "image" .Params.image + "context" . + ) -}} + + <div class="document-content"> + {{ partial "toc/container.html" + (dict + "toc" "sitemap/toc.html" + "context" . + ) }} + + {{ partial "sitemap/summary.html" (dict + "context" . + "block_wrapped" true + ) }} + + {{ partial "blocks/list.html" . }} + + {{ range .Site.Sections }} + {{ if ne .Type "sitemap" }} + {{ $permalink := .Permalink }} + <section class="block block-sitemap" id="{{ .Type }}"> + <div class="container"> + <div class="block-content"> + <h3> + <a href="{{ $permalink }}">{{ safeHTML .Title }}</a> + </h3> + <ul> + {{ range where .Site.Pages "Section" .Type }} + {{ if ne $permalink .Permalink }} + <li><a href="{{ .Permalink }}">{{ safeHTML .Title }}</a></li> + {{ end }} + {{ end }} + </ul> + </div> + </div> + </section> + {{ end }} + {{ end }} + </div> +{{ end }} diff --git a/layouts/papers/list.html b/layouts/papers/list.html index 4453146f2e2d7e8fa3d76391a3650f970311f066..7337cbee8f8a6cb43a5260a514ff1ab84c22c02b 100644 --- a/layouts/papers/list.html +++ b/layouts/papers/list.html @@ -3,6 +3,7 @@ (dict "title" .Title "image" .Params.image + "sizes" site.Params.image_sizes.sections.papers.hero "context" . ) -}} <div class="document-content"> diff --git a/layouts/papers/single.html b/layouts/papers/single.html index 8965c2c0d5c9bbe84e3038d9d95d20f6a55ce05f..0157d4c05e7e332532479a3d3ad8979137367f75 100644 --- a/layouts/papers/single.html +++ b/layouts/papers/single.html @@ -3,6 +3,7 @@ (dict "title" .Title "image" .Params.image + "sizes" site.Params.image_sizes.sections.papers.hero_single "context" . ) -}} <div class="document-content" itemscope itemtype="https://schema.org/ScholarlyArticle"> diff --git a/layouts/partials/GetImageUrlKeycdn b/layouts/partials/GetImageUrlKeycdn index 2a02dbb7b4070044b009108360a1b477334b3aef..9b2cee0865413985921fa880bb1ba4f3e0868194 100644 --- a/layouts/partials/GetImageUrlKeycdn +++ b/layouts/partials/GetImageUrlKeycdn @@ -10,6 +10,7 @@ {{ end }} {{ $scale := .scale }} {{ $fit := "" }} +{{ $quality := "" }} {{ with .size }} {{ $sizes := split . "x" }} {{ $width := int (index $sizes 0) }} @@ -17,6 +18,7 @@ {{ with $scale }} {{ $width = mul $width $scale }} {{ $height = mul $height $scale }} + {{ $quality = 50 }} {{ end }} {{ $fit = "inside" }} {{ $result = printf "%swidth=%d&height=%d&" $result $width $height }} @@ -28,4 +30,7 @@ {{ if ne $fit "" }} {{ $result = printf "%s&fit=%s" $result $fit }} {{ end }} +{{ if ne $quality "" }} + {{ $result = printf "%s&quality=%d" $result $quality }} +{{ end }} {{ return $result }} diff --git a/layouts/partials/GetLightboxUrl b/layouts/partials/GetLightboxUrl index e4993a61a28b2d8ee7404f7b90aa164534caafc7..7ea489ee683acb9ab20a9bb78db8964cfac488c8 100644 --- a/layouts/partials/GetLightboxUrl +++ b/layouts/partials/GetLightboxUrl @@ -2,7 +2,7 @@ {{ if isset . "id" }} {{ $id = .id }} {{ end }} -{{ $lightbox_sizes := "1920x2560" }} +{{ $lightbox_sizes := site.Params.image_sizes.design_system.lightbox.desktop }} {{ $image := partial "GetMedia" $id }} {{ $url := "" }} 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 2fae0fcd15833a1425802a055badca8d9b6c633b..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,16 +38,13 @@ {{- end -}} </div> {{- end -}} - </div> {{ partial "commons/image.html" (dict "image" .image.file "alt" .image.alt - "mobile" "164x164" - "tablet" "336x336" - "desktop" "416x416" + "sizes" site.Params.image_sizes.blocks.call_to_action )}} </div> diff --git a/layouts/partials/blocks/templates/chapter.html b/layouts/partials/blocks/templates/chapter.html index bb0c6750ef72e22130a8f1d47d3201954e9dfb07..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) -}} @@ -46,9 +46,7 @@ {{ partial "commons/image.html" (dict "image" .image - "mobile" "350x350" - "tablet" "450x450" - "desktop" "1280x1280" + "sizes" site.Params.image_sizes.blocks.chapter )}} </a> {{ if partial "GetTextFromHTML" .credit }} 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 a07cf8b9f0804b63826e360a47279e5d24fea368..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"> @@ -31,7 +30,7 @@ {{ range .rows }} <tr> {{ range . }} - <td>{{ . }}</td> + <td>{{ . | markdownify }}</td> {{ end }} </tr> {{ end }} 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/gallery/carousel.html b/layouts/partials/blocks/templates/gallery/carousel.html index 67fdbeb154f55666b3be33df492a9f0ead189ffd..a787ab3f2ef92ef36950e507f2c1c6b44f7bb5b9 100644 --- a/layouts/partials/blocks/templates/gallery/carousel.html +++ b/layouts/partials/blocks/templates/gallery/carousel.html @@ -23,9 +23,7 @@ (dict "image" .id "alt" .alt - "mobile" "400" - "tablet" "600" - "desktop" "1024" + "sizes" site.Params.image_sizes.blocks.gallery.carousel )}} </a> {{ if or .text .credit }} diff --git a/layouts/partials/blocks/templates/gallery/grid.html b/layouts/partials/blocks/templates/gallery/grid.html index b87645234ae62df56904bfae48a13fca6ae19de0..fe5a4a1cc4da6785a27e3580bbce659156c2c5f2 100644 --- a/layouts/partials/blocks/templates/gallery/grid.html +++ b/layouts/partials/blocks/templates/gallery/grid.html @@ -13,9 +13,7 @@ (dict "image" .file "alt" .alt - "mobile" "164" - "tablet" "336" - "desktop" "416" + "sizes" site.Params.image_sizes.blocks.gallery.grid )}} </a> {{ if .text }} diff --git a/layouts/partials/blocks/templates/image.html b/layouts/partials/blocks/templates/image.html index f27221ffb6646ba51e0da06ed8325d35176dcfea..2bc4ef561c90b319677aa6348178501b123eeada 100644 --- a/layouts/partials/blocks/templates/image.html +++ b/layouts/partials/blocks/templates/image.html @@ -1,49 +1,41 @@ -{{- $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" (dict "image" . "alt" .alt - "mobile" "480x850" - "tablet" "768x1360" - "desktop" "1400x1820" + "sizes" site.Params.image_sizes.blocks.image )}} </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 1d3a03d0ff2ee5ee28e246460105fb030dcdb2b0..a515fd200b1c316fb6ab9e9321455b1266766d36 100644 --- a/layouts/partials/blocks/templates/organization_chart.html +++ b/layouts/partials/blocks/templates/organization_chart.html @@ -1,17 +1,19 @@ -{{- $context := .context -}} +{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- with .block.data -}} {{- $with_link := .with_link -}} + {{- $with_photo := .with_photo -}} <section class="block block-organization_chart{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <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 }} @@ -22,41 +24,40 @@ <div class="persons"> {{- range .persons -}} {{ $person := site.GetPage (printf "/persons/%s" .slug) }} - <div> - <article class="person" itemscope itemtype="https://schema.org/Person"> - <div class="description"> - <h1 class="name" itemprop="name"> - {{ if $with_link }} - <a href="{{ $person.Permalink }}" aria-label="{{ i18n "commons.more_aria" (dict "Title" $person.Title) }}"> - {{ end }} - {{- partial "PrepareHTML" $person.Title -}} - {{ if $with_link }} - </a> + <article class="person" itemscope itemtype="https://schema.org/Person"> + <div class="description"> + <h3 class="name" itemprop="name"> + {{ if $with_link }} + <a href="{{ $person.Permalink }}" aria-label="{{ i18n "commons.more_aria" (dict "Title" $person.Title) }}"> {{ end }} - </h1> - <p itemprop="jobTitle"> - {{- if (partial "GetTextFromHTML" .role) }} - {{ partial "PrepareHTML" .role }} - {{- else if partial "GetTextFromHTML" $person.Params.description_short }} - {{- partial "PrepareHTML" $person.Params.description_short -}} - {{ else if (partial "GetTextFromHTML" $person.Content) }} - {{- partial "GetTruncateContent" ( dict "text" $person.Content ) -}} - {{ end -}} - </p> - </div> + {{- partial "PrepareHTML" $person.Title -}} + {{ if $with_link }} + </a> + {{ end }} + </h3> + <p itemprop="jobTitle"> + {{- if (partial "GetTextFromHTML" .role) }} + {{ partial "PrepareHTML" .role }} + {{- else if partial "GetTextFromHTML" $person.Params.summary }} + {{- partial "PrepareHTML" $person.Params.summary -}} + {{ else if (partial "GetTextFromHTML" $person.Content) }} + {{- partial "GetTruncateContent" ( dict "text" $person.Content ) -}} + {{ end -}} + </p> + </div> + {{- if $with_photo }} <div class="avatar" itemprop="image"> {{- if $person.Params.image }} {{ partial "commons/image.html" - (dict - "image" $person.Params.image - "mobile" "80x80" - "tablet" "100x100" - "desktop" "255x255" - )}} + (dict + "image" $person.Params.image + "sizes" site.Params.image_sizes.blocks.organization_chart + )}} {{ end -}} </div> - </article> - </div> + {{ end -}} + </article> + {{- end -}} </div> </div> diff --git a/layouts/partials/blocks/templates/pages.html b/layouts/partials/blocks/templates/pages.html index 3c0e421eab5527b52c4e8e6d6d7153521c9de061..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" -}} @@ -40,28 +40,27 @@ {{- $page_class = partial "GetBodyclass" . }} {{- $page_class = printf "block-%s" $page_class }} {{ end }} - {{ if site.Params.pages.list.truncate_description }} + {{ if site.Params.pages.index.truncate_description }} {{- $main_description = partial "GetTruncateContent" ( dict - "text" .Params.description_short - "length" site.Params.pages.list.truncate_description + "text" .Params.summary + "length" site.Params.pages.index.truncate_description ) -}} {{ else }} - {{- $main_description = partial "PrepareHTML" .Params.description_short -}} + {{- $main_description = partial "PrepareHTML" .Params.summary -}} {{ end }} {{ end -}} <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 79a9e1cb26ffadcba22ecb7d55bbe19721b8f786..f6bf4e3bc28f8e6363842d9f6314324bb3a0e809 100644 --- a/layouts/partials/blocks/templates/pages/cards.html +++ b/layouts/partials/blocks/templates/pages/cards.html @@ -5,24 +5,25 @@ {{ range .pages }} {{- $page := partial "GetPageByUrl" .page -}} {{- if .slug -}} + {{/* LEGACY */}} {{- $page = partial "GetPageByUrl" .slug -}} {{- end -}} {{ with $page }} <article class="card"> - <h1> + <h3> <a href="{{- .Permalink -}}"> {{- partial "PrepareHTML" .Title -}} </a> - </h1> + </h3> - {{ if and $show_descriptions .Params.description_short }} - {{ if site.Params.pages.list.truncate_description }} + {{ if and $show_descriptions .Params.summary }} + {{ if site.Params.pages.index.truncate_description }} <p>{{ partial "GetTruncateContent" ( dict - "text" .Params.description_short - "length" site.Params.pages.list.truncate_description + "text" .Params.summary + "length" site.Params.pages.index.truncate_description ) }}</p> {{ else }} - <p>{{ partial "PrepareHTML" .Params.description_short }}</p> + <p>{{ partial "PrepareHTML" .Params.summary }}</p> {{ end }} {{ end }} diff --git a/layouts/partials/blocks/templates/pages/grid.html b/layouts/partials/blocks/templates/pages/grid.html index 9ea52a3290074e64c219f1ec1882e60833127785..fd28a25a403dea8157e9582023d2319389e4eb3c 100644 --- a/layouts/partials/blocks/templates/pages/grid.html +++ b/layouts/partials/blocks/templates/pages/grid.html @@ -10,6 +10,7 @@ {{- if .page -}} {{- $page = partial "GetPageByUrl" .page -}} {{- else if .slug -}} + {{/* LEGACY */}} {{- $page = partial "GetPageByUrl" .slug -}} {{ end }} {{ else }} @@ -18,19 +19,19 @@ {{ with $page }} <article> - <h1> + <h3> <a href="{{- .Permalink -}}"> {{- partial "PrepareHTML" .Title -}} </a> - </h1> - {{ if and $show_descriptions .Params.description_short }} - {{ if site.Params.pages.list.truncate_description }} + </h3> + {{ if and $show_descriptions .Params.summary }} + {{ if site.Params.pages.index.truncate_description }} <p>{{ partial "GetTruncateContent" ( dict - "text" .Params.description_short - "length" site.Params.pages.list.truncate_description + "text" .Params.summary + "length" site.Params.pages.index.truncate_description ) }}</p> {{ else }} - <p>{{ partial "PrepareHTML" .Params.description_short }}</p> + <p>{{ partial "PrepareHTML" .Params.summary }}</p> {{ end }} {{ end }} {{ if $show_images }} diff --git a/layouts/partials/blocks/templates/pages/list.html b/layouts/partials/blocks/templates/pages/list.html index a699ecb9c3df1ea2098377abe6e40d7778a7da29..f30cb416d2672df18b51fb0562d2d89c035478ed 100644 --- a/layouts/partials/blocks/templates/pages/list.html +++ b/layouts/partials/blocks/templates/pages/list.html @@ -2,6 +2,7 @@ {{ range .pages }} {{- $page := partial "GetPageByUrl" .page -}} {{- if .slug -}} + {{/* LEGACY */}} {{- $page = partial "GetPageByUrl" .slug -}} {{- end -}} {{ with $page }} diff --git a/layouts/partials/blocks/templates/partners.html b/layouts/partials/blocks/templates/partners.html index 072f9deeb93a5bf90e9546e4dc1fe777e2262310..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"> @@ -51,9 +50,7 @@ (dict "image" .logo "alt" $title - "mobile" "164" - "tablet" "216" - "desktop" "196" + "sizes" site.Params.image_sizes.blocks.partners ) -}} {{- end -}} </div> 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 8dddd8449c51adb02f08d635e6a43abbecfdd605..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,18 +20,18 @@ {{ 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> - {{ if site.Params.posts.list.show_categories }} + <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 }} - {{- if (partial "GetTextFromHTML" .Params.description_short) -}} - {{ if site.Params.posts.list.truncate_description }} + {{- if (partial "GetTextFromHTML" .Params.summary) -}} + {{ if site.Params.posts.index.truncate_description }} <p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict - "text" .Params.description_short - "length" site.Params.posts.list.truncate_description + "text" .Params.summary + "length" site.Params.posts.index.truncate_description ) }}</p> {{ else }} - <p itemprop="articleBody">{{ partial "PrepareHTML" .Params.description_short }}</p> + <p itemprop="articleBody">{{ partial "PrepareHTML" .Params.summary }}</p> {{ end }} {{- end -}} <time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format ":date_long" }}</time> diff --git a/layouts/partials/blocks/templates/posts/list.html b/layouts/partials/blocks/templates/posts/list.html index ac8dbb0e4cf2f6b1516a592bdbf770fddb1858eb..1b26319b3fb3137101bccbe7e01236b7e12f08f5 100644 --- a/layouts/partials/blocks/templates/posts/list.html +++ b/layouts/partials/blocks/templates/posts/list.html @@ -1,7 +1,9 @@ <div class="list"> {{ 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/programs.html b/layouts/partials/blocks/templates/programs.html index a783e9d5662c0d452285bda009ef7b8170b5976a..377ffdae59bf69ded61d67157ed30f79ebbe586b 100644 --- a/layouts/partials/blocks/templates/programs.html +++ b/layouts/partials/blocks/templates/programs.html @@ -1,23 +1,22 @@ -{{- $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 -}} <ol class="programs"> {{- range .programs -}} <li> - {{ $program := site.GetPage (printf "/programs/%s" .slug) }} + {{ $program := site.GetPage (printf "/programs%s" .path) }} {{- $title := partial "PrepareHTML" $program.Title -}} <a href="{{ $program.Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}"> {{- $title -}} @@ -25,10 +24,6 @@ </li> {{ end }} </ol> - {{/* TODO : use program list partial ? - {{ partial "programs/programs-list.html" .programs }} - */}} - </div> </div> </section> diff --git a/layouts/partials/blocks/templates/testimonials.html b/layouts/partials/blocks/templates/testimonials.html index d86ba1531342c00c59b710d56cba4985ee2643f1..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 -}} @@ -7,16 +7,13 @@ {{ if gt (len .testimonials) 1 }} {{- $is_carousel = true -}} {{ end }} - <section class="block block-testimonials{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> + <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"> @@ -51,9 +48,7 @@ (dict "image" .photo "alt" .author - "mobile" "192x192" - "tablet" "192x192" - "desktop" "192x192" + "sizes" site.Params.image_sizes.blocks.testimonials ) -}} </div> {{- end }} 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/templates/video/GetIframe b/layouts/partials/blocks/templates/video/GetIframe index dd720fcdb7527f3ada13f3f84bd72b63a0f2758a..947f0b926c56231d0c144b446928d9399ca32ef7 100644 --- a/layouts/partials/blocks/templates/video/GetIframe +++ b/layouts/partials/blocks/templates/video/GetIframe @@ -53,3 +53,9 @@ {{ end }} {{ end }} {{ end }} +{{ if not $identifier }} + {{ partial "blocks/templates/video/iframe.html" (dict + "url" $url + "title" $title + )}} +{{ end }} diff --git a/layouts/partials/blocks/templates/video/iframe.html b/layouts/partials/blocks/templates/video/iframe.html new file mode 100644 index 0000000000000000000000000000000000000000..65585f5a5264ffaffc12d1582dccc6ebd1bb0852 --- /dev/null +++ b/layouts/partials/blocks/templates/video/iframe.html @@ -0,0 +1,5 @@ +<iframe + src="{{ .url }}" + title="{{ .title }}" + loading="lazy"> +</iframe> \ No newline at end of file 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/categories/chapo.html b/layouts/partials/categories/chapo.html deleted file mode 100644 index 4117ac68595d2f5ffaf25d0f39e028072afdbaab..0000000000000000000000000000000000000000 --- a/layouts/partials/categories/chapo.html +++ /dev/null @@ -1 +0,0 @@ -{{- partial "commons/chapo.html" . -}} diff --git a/layouts/partials/categories/hero-list.html b/layouts/partials/categories/hero-list.html index 0a48273d269ebe615febe47fa9fec8999ef76c53..4cb482eb1016eae37cd284843efa2518fbe0ffee 100644 --- a/layouts/partials/categories/hero-list.html +++ b/layouts/partials/categories/hero-list.html @@ -1,5 +1,6 @@ {{- partial "header/hero.html" (dict - "title" .Title - "context" . + "title" .Title + "sizes" site.Params.image_sizes.sections.categories.hero + "context" . ) -}} diff --git a/layouts/partials/categories/hero-term.html b/layouts/partials/categories/hero-term.html index 0a48273d269ebe615febe47fa9fec8999ef76c53..f3573430e6a73ed3f3a50e826644a774208096aa 100644 --- a/layouts/partials/categories/hero-term.html +++ b/layouts/partials/categories/hero-term.html @@ -1,5 +1,7 @@ {{- partial "header/hero.html" - (dict - "title" .Title - "context" . - ) -}} + (dict + "title" .Title + "image" .Params.image + "sizes" site.Params.image_sizes.sections.categories.hero_term + "context" . + ) -}} diff --git a/layouts/partials/categories/summary.html b/layouts/partials/categories/summary.html new file mode 100644 index 0000000000000000000000000000000000000000..4ed5a570f5d60bc07d29393efb221e5fa06a7b8b --- /dev/null +++ b/layouts/partials/categories/summary.html @@ -0,0 +1 @@ +{{- partial "commons/summary.html" . -}} diff --git a/layouts/partials/commons/image-default.html b/layouts/partials/commons/image-default.html index dc08e99b28680276be5fdf7ad964bf22b3a5290f..014f0eb47a2a95d79832653f25c60d2645eb6360 100644 --- a/layouts/partials/commons/image-default.html +++ b/layouts/partials/commons/image-default.html @@ -1,4 +1,4 @@ -{{ if os.FileExists "static/assets/images/default.png" }} +{{- if os.FileExists "static/assets/images/default.png" -}} {{ $file := "/assets/images/default.png" }} {{ $fileDimensions := partial "GetImageDimensions" (dict "context" . "file" $file "static" true) }} {{- $lazy := default true .lazy -}} @@ -14,4 +14,4 @@ {{- if .class }} class="{{ .class }}"{{- end -}} {{- if $lazy }} loading="lazy"{{- end -}} > -{{ end }} +{{- end -}} diff --git a/layouts/partials/commons/image.html b/layouts/partials/commons/image.html index 8c43d6fc9b414cca23afa6632e812fdfdf6ebbe4..02fcadf3d8e4f14d8311cabd41753f31ffff10a4 100644 --- a/layouts/partials/commons/image.html +++ b/layouts/partials/commons/image.html @@ -24,7 +24,16 @@ {{- if .crop -}} {{- $crop = true -}} {{- end -}} - <picture> + {{ $desktop := .desktop }} + {{ $tablet := .tablet }} + {{ $mobile := .mobile }} + {{- if .sizes -}} + {{ $desktop = .sizes.desktop }} + {{ $tablet = .sizes.tablet }} + {{ $mobile = .sizes.mobile }} + {{- end -}} + {{ $is_svg := strings.HasSuffix $image.name "svg" }} + <picture {{ if $is_svg }}class="is-svg"{{ end }}> {{- if strings.HasSuffix $image.name "svg" -}} @@ -39,32 +48,32 @@ {{- else -}} - {{ with .desktop -}} + {{ with $desktop -}} <source srcset="{{ partial "GetImageUrl" (dict "url" $url "size" . "format" "webp" "crop" $crop ) }}, {{ partial "GetImageUrl" (dict "url" $url "size" . "format" "webp" "scale" 2 "crop" $crop) }} 2x" media="(min-width: 1024px)" type="image/webp"> {{- end }} - {{ with .tablet -}} + {{ with $tablet -}} <source srcset="{{ partial "GetImageUrl" (dict "url" $url "size" . "format" "webp" "crop" $crop) }}, {{ partial "GetImageUrl" (dict "url" $url "size" . "format" "webp" "scale" 2 "crop" $crop) }} 2x" media="(min-width: 768px)" type="image/webp"> {{- end }} - {{ with .mobile -}} + {{ with $mobile -}} <source srcset="{{ partial "GetImageUrl" (dict "url" $url "size" . "format" "webp" "crop" $crop) }}, {{ partial "GetImageUrl" (dict "url" $url "size" . "format" "webp" "scale" 2 "crop" $crop) }} 2x" type="image/webp"> {{- end }} - {{ with .desktop -}} + {{ with $desktop -}} <source srcset="{{ partial "GetImageUrl" (dict "url" $url "size" . "crop" $crop ) }}, {{ partial "GetImageUrl" (dict "url" $url "size" . "scale" 2 "crop" $crop) }} 2x" media="(min-width: 1024px)"> {{- end }} - {{ with .tablet -}} + {{ with $tablet -}} <source srcset="{{ partial "GetImageUrl" (dict "url" $url "size" . "crop" $crop ) }}, {{ partial "GetImageUrl" (dict "url" $url "size" . "scale" 2 "crop" $crop) }} 2x" media="(min-width: 768px)"> {{- end }} - {{ with .mobile -}} + {{ with $mobile -}} <source srcset="{{ partial "GetImageUrl" (dict "url" $url "size" . "crop" $crop ) }}, {{ partial "GetImageUrl" (dict "url" $url "size" . "scale" 2 "crop" $crop) }} 2x"> {{- end }} diff --git a/layouts/partials/commons/chapo.html b/layouts/partials/commons/summary.html similarity index 60% rename from layouts/partials/commons/chapo.html rename to layouts/partials/commons/summary.html index ceeb73022448e7ddda64c5f2fa38c8f7ea9c3d97..62f87cd003bffc307ed2745f7939b7e47b3df415 100644 --- a/layouts/partials/commons/chapo.html +++ b/layouts/partials/commons/summary.html @@ -1,17 +1,17 @@ -{{- $text := (partial "GetTextFromHTML" .context.Params.description_short) -}} +{{- $text := (partial "GetTextFromHTML" .context.Params.summary) -}} {{- if $text -}} {{- if .block_wrapped -}} - <section class="block block-chapo"> + <section class="block block-summary"> <div class="container"> <div class="block-content"> {{- else if .with_container -}} <div class="container"> {{- end -}} - <p class="lead"> - {{ partial "PrepareHTML" .context.Params.description_short }} + <p class="lead" role="heading" aria-level="2"> + {{ partial "PrepareHTML" .context.Params.summary }} </p> {{- if .block_wrapped -}} diff --git a/layouts/partials/diplomas/chapo.html b/layouts/partials/diplomas/chapo.html deleted file mode 100644 index 4117ac68595d2f5ffaf25d0f39e028072afdbaab..0000000000000000000000000000000000000000 --- a/layouts/partials/diplomas/chapo.html +++ /dev/null @@ -1 +0,0 @@ -{{- partial "commons/chapo.html" . -}} diff --git a/layouts/partials/diplomas/diplomas.html b/layouts/partials/diplomas/diplomas.html index 2907cb378487b6bc4f4f744d5637776d2e1377b8..aa7c86ce5d780de048d1b0768fa34873128c0d53 100644 --- a/layouts/partials/diplomas/diplomas.html +++ b/layouts/partials/diplomas/diplomas.html @@ -11,7 +11,7 @@ </a> <div class="content"> <div class="description"> - {{- partial "PrepareHTML" .Params.description_short -}} + {{- partial "PrepareHTML" .Params.summary -}} </div> <ol class="programs"> diff --git a/layouts/partials/diplomas/hero-list.html b/layouts/partials/diplomas/hero-list.html index 8e7e675c055dce99ef4dda14b248d20db258f721..b272a7170a4114164a9dc3811d72b2fffd1e0168 100644 --- a/layouts/partials/diplomas/hero-list.html +++ b/layouts/partials/diplomas/hero-list.html @@ -1,7 +1,8 @@ {{- $title := or .Params.header_text .Title -}} {{- partial "header/hero.html" - (dict - "title" $title - "image" .Params.image - "context" . - ) -}} + (dict + "title" $title + "image" .Params.image + "sizes" site.Params.image_sizes.sections.diplomas.hero + "context" . + ) -}} diff --git a/layouts/partials/diplomas/hero-single.html b/layouts/partials/diplomas/hero-single.html index 4577aee8825ae95a57a16100206e2ade1236c045..6bd1f4316602337264941abc45c0d527d90bb5aa 100644 --- a/layouts/partials/diplomas/hero-single.html +++ b/layouts/partials/diplomas/hero-single.html @@ -11,9 +11,7 @@ {{ partial "commons/image.html" (dict "image" .image - "mobile" "351" - "tablet" "456" - "desktop" "856" + "sizes" site.Params.image_sizes.sections.diplomas.hero_single ) }} {{ if .image.credit }} <figcaption> diff --git a/layouts/partials/diplomas/image.html b/layouts/partials/diplomas/image.html deleted file mode 100644 index 40868e727950f41c194bdb7ed27a4580fd33944d..0000000000000000000000000000000000000000 --- a/layouts/partials/diplomas/image.html +++ /dev/null @@ -1,17 +0,0 @@ -{{ if . }} - <figure class="featured-image"> - {{ partial "commons/image.html" - (dict - "image" . - "mobile" "351x168" - "tablet" "456x219" - "desktop" "856x410" - "itemprop" true - )}} - {{- if isset . "credit" -}} - {{ if partial "GetTextFromHTML" .credit }} - <figcaption>{{ partial "PrepareHTML" .credit }}</figcaption> - {{ end }} - {{- end -}} - </figure> -{{ end }} diff --git a/layouts/partials/diplomas/summary.html b/layouts/partials/diplomas/summary.html new file mode 100644 index 0000000000000000000000000000000000000000..4ed5a570f5d60bc07d29393efb221e5fa06a7b8b --- /dev/null +++ b/layouts/partials/diplomas/summary.html @@ -0,0 +1 @@ +{{- partial "commons/summary.html" . -}} diff --git a/layouts/partials/footer/debug.html b/layouts/partials/footer/debug.html index 7ca6990f64c2124768f1cbf2f457e1d66b19cd78..ea1cd83f29104ea280b3dc172d83da5346de2bec 100644 --- a/layouts/partials/footer/debug.html +++ b/layouts/partials/footer/debug.html @@ -161,8 +161,39 @@ document.body.classList.toggle('full-width'); } }); + window.addEventListener('pointermove', e => { document.querySelector('.d-cross').style.left = e.clientX + "px"; document.querySelector('.d-cross').style.top = e.clientY + "px"; + }); + + document.querySelectorAll('img').forEach(img => { + img.addEventListener('click', e => { + if (e.altKey) { + e.preventDefault() + e.stopImmediatePropagation() + responsiveImageDebugOutput(img) + } + }) }) + + function responsiveImageDebugOutput(img) { + if (!img) { + throw new TypeError("Expected an image node. Got none."); + } + const listener = function () { + const pixelRatio = window.devicePixelRatio > 1 ? 2 : 1; + const dimensionWidth = img.naturalWidth * pixelRatio; + const dimensionHeight = img.naturalHeight * pixelRatio; + console.log(` + ------------------------- + Rendered size: ${img.width}x${img.height} + Intrinsic size: ${dimensionWidth}x${dimensionHeight} + Device Pixel Ratio: ${window.devicePixelRatio} + ------------------------- + `); + }; + if (img.complete) listener(); + //img.addEventListener('load', listener); + } </script> \ No newline at end of file diff --git a/layouts/partials/head/seo.html b/layouts/partials/head/seo.html index e7c07467748edc62fe25fbadaad435e0335ef84c..1a4694524eead60fee5462b39ccaf5e3ef0a3a75 100644 --- a/layouts/partials/head/seo.html +++ b/layouts/partials/head/seo.html @@ -3,10 +3,12 @@ {{- $seoTitle = printf "%s | %s" (chomp (htmlUnescape .Title)) $seoTitle -}} {{- end -}} {{- $seoDescription := "" -}} -{{- if .Params.description -}} - {{- $seoDescription = partial "PrepareHTML" .Params.description -}} -{{- else if .Params.description_short -}} - {{- $seoDescription = partial "PrepareHTML" .Params.description_short -}} +{{- if .Params.meta_description -}} + {{- $seoDescription = partial "PrepareHTML" .Params.meta_description -}} +{{- else if .Params.description -}} + {{- $seoDescription = partial "PrepareHTML" .Params.description -}} {{/* LEGACY */}} +{{- else if .Params.summary -}} + {{- $seoDescription = partial "PrepareHTML" .Params.summary -}} {{- else if .Content -}} {{- $seoDescription = partial "GetTruncateContent" ( dict "text" .Content ) -}} {{- else if .Params.legacy_text -}} diff --git a/layouts/partials/header/breadcrumbs.html b/layouts/partials/header/breadcrumbs.html index 21f94aa0e9342cdb93f20ace7537e81dfd91dea5..756de5f76b3df253a15d4a65abae11a9db51a9ec 100644 --- a/layouts/partials/header/breadcrumbs.html +++ b/layouts/partials/header/breadcrumbs.html @@ -8,7 +8,7 @@ "p2" . "path" $path "position" $length - ) }} + ) -}} </ol> </nav> @@ -47,13 +47,13 @@ {{- end -}} {{- $title = chomp $title }} <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" class="breadcrumb-item{{- if .active }} active{{ end }}"{{- if .active }} aria-current="page"{{ end }}> - {{ if not .active -}} + {{- if not .active -}} <a itemprop="item" href="{{ .page.Permalink }}"> - {{- end }} + {{- end -}} <span itemprop="name">{{- partial "PrepareHTML" $title -}}</span> - {{ if not .active -}} + {{- if not .active -}} </a> - {{- end }} + {{- end -}} <meta itemprop="position" content="{{- .position -}}"> </li> {{- end -}} diff --git a/layouts/partials/header/hero.html b/layouts/partials/header/hero.html index 9cb3207efe68471fd085da077a4f7ff0e3514a49..45be3537a1e573cdda176e5593423074eb0519b7 100644 --- a/layouts/partials/header/hero.html +++ b/layouts/partials/header/hero.html @@ -5,8 +5,10 @@ <header class="hero {{ if .image -}}hero--with-image hero--image-{{- $direction -}}{{- end -}}"> <div class="container"> - {{- if .breadcrumb | default true -}} - {{ partial "header/breadcrumbs.html" .context }} + {{- if eq site.Params.breadcrumb.position "hero-start" -}} + {{- if .breadcrumb | default true -}} + {{ partial "header/breadcrumbs.html" .context }} + {{- end -}} {{- end -}} <div class="content"> {{- if .subtitle -}} @@ -27,9 +29,7 @@ {{ partial "commons/image.html" (dict "image" .image - "mobile" "400" - "tablet" "800" - "desktop" "900" + "sizes" ( .sizes | default site.Params.image_sizes.design_system.hero ) "lazy" false ) }} {{ if .image.credit }} @@ -43,5 +43,18 @@ </figure> {{ end -}} </div> + {{- if eq site.Params.breadcrumb.position "hero-end" -}} + {{- if .breadcrumb | default true -}} + {{ partial "header/breadcrumbs.html" .context }} + {{- end -}} + {{- end -}} </div> </header> + +{{- if eq site.Params.breadcrumb.position "after-hero" -}} + {{- if .breadcrumb | default true -}} + <div class="container"> + {{ partial "header/breadcrumbs.html" .context }} + </div> + {{- end -}} +{{- end -}} \ No newline at end of file diff --git a/layouts/partials/home/chapo.html b/layouts/partials/home/chapo.html deleted file mode 100644 index 4117ac68595d2f5ffaf25d0f39e028072afdbaab..0000000000000000000000000000000000000000 --- a/layouts/partials/home/chapo.html +++ /dev/null @@ -1 +0,0 @@ -{{- partial "commons/chapo.html" . -}} diff --git a/layouts/partials/home/hero.html b/layouts/partials/home/hero.html index 0a012b577b42588e45ff61e2ebd3e56934f77810..0a8f6680f38c164b9adc7f8be15858d7cba30523 100644 --- a/layouts/partials/home/hero.html +++ b/layouts/partials/home/hero.html @@ -4,5 +4,6 @@ "title" $title "image" .Params.image "breadcrumb" false + "sizes" site.Params.image_sizes.sections.home.hero "context" . )}} diff --git a/layouts/partials/home/summary.html b/layouts/partials/home/summary.html new file mode 100644 index 0000000000000000000000000000000000000000..4ed5a570f5d60bc07d29393efb221e5fa06a7b8b --- /dev/null +++ b/layouts/partials/home/summary.html @@ -0,0 +1 @@ +{{- partial "commons/summary.html" . -}} diff --git a/layouts/partials/organizations/contact-details.html b/layouts/partials/organizations/contact-details.html new file mode 100644 index 0000000000000000000000000000000000000000..66f8a713c0f8790b16495e421bf9d52dfa707e16 --- /dev/null +++ b/layouts/partials/organizations/contact-details.html @@ -0,0 +1,84 @@ +{{ with .Params.contact_details }} + {{ if or .website .linkedin .twitter .email .address .city .zipcode .country .phone }} + <div class="contacts-details"> + {{ if or .website .linkedin .twitter .email }} + <ul> + {{ with .website }} + <li> + <span>{{ i18n "commons.contact.website" }}</span> + <a href="{{ chomp .value }}" target="_blank" rel="noopener" itemprop="url">{{ chomp .label }}</a> + </li> + {{ end }} + + {{ with .linkedin }} + <li> + <span>LinkedIn</span> + <a href="{{ chomp .value }}" target="_blank" rel="noopener" itemprop="url">{{ chomp .label }}</a> + </li> + {{ end }} + + {{ with .mastodon }} + <li> + <span>Mastodon</span> + <a href="{{ chomp .value }}" target="_blank" rel="noopener" itemprop="url">{{ chomp .label }}</a> + </li> + {{ end }} + + {{ with .twitter }} + <li> + <span>Twitter</span> + <a href="{{ chomp .value }}" target="_blank" rel="noopener" itemprop="url">{{ chomp .label }}</a> + </li> + {{ end }} + + {{ with .email }} + <li> + <span>{{ i18n "commons.contact.email" }}</span> + <a href="{{ chomp .value }}" itemprop="email">{{ chomp .label }}</a> + </li> + {{ end }} + </ul> + {{ end }} + + {{ if or .address .city .zipcode .country .phone }} + <ul> + {{ if or .address .city .zipcode .country }} + <li> + <span>{{ i18n "commons.contact.address" }}</span> + <address itemprop="address" itemscope itemtype="https://schema.org/PostalAddress"> + {{ with .address }} + <span itemprop="streetAddress"> + {{ partial "PrepareHTML" .label }}, + </span> + <br> + {{ end }} + {{ with .city }} + <span itemprop="addressLocality"> + {{ partial "PrepareHTML" .label }} + </span> + {{ end }} + {{ with .zipcode }} + <span itemprop="postalCode"> + {{ partial "PrepareHTML" .label }} + </span> + {{ end }} + {{ with .country }} + <span itemprop="postalCode"> + {{ partial "PrepareHTML" .label }} + </span> + {{ end }} + </address> + </li> + {{ end }} + + {{ with .phone }} + <li> + <span>{{ i18n "commons.contact.phone" }}</span> + <a href="{{ .value }}" itemprop="telephone">{{ .label }}</a> + </li> + {{ end }} + </ul> + {{ end }} + </div> + {{ end }} +{{ end }} diff --git a/layouts/partials/organizations/contacts.html b/layouts/partials/organizations/contacts.html deleted file mode 100644 index c2a6e29c887932270f8ed021b4032820f1eabaf2..0000000000000000000000000000000000000000 --- a/layouts/partials/organizations/contacts.html +++ /dev/null @@ -1,36 +0,0 @@ -<ul class="contacts-list"> - {{ if .Params.linkedin }} - <li> - <span>Linkedin</span> - <a href="mailto:{{ .Params.linkedin }}" target="_blank" rel="noopener" itemprop="url">{{ .Params.linkedin }}</a> - </li> - {{ end }} - - {{ if .Params.twitter }} - <li> - <span>Twitter</span> - <a href="https://twitter.com/{{ .Params.twitter }}" target="_blank" rel="noopener" itemprop="url">{{ .Params.twitter }}</a> - </li> - {{ end }} - - {{ if .Params.website }} - <li> - <span>{{ i18n "commons.contact.website" }}</span> - <a href="{{ .Params.website }}" target="_blank" rel="noopener" itemprop="url">{{ .Params.website }}</a> - </li> - {{ end }} - - {{ if .Params.email }} - <li> - <span>{{ i18n "commons.contact.email" }}</span> - <a href="mailto:{{ .Params.email }}" itemprop="email">{{ .Params.email }}</a> - </li> - {{ end }} - - {{ if .Params.phone }} - <li> - <span>{{ i18n "commons.contact.phone" }}</span> - <a href="tel:{{ .Params.phone }}" itemprop="telephone">{{ .Params.phone }}</a> - </li> - {{ end }} -</ul> diff --git a/layouts/partials/organizations/content.html b/layouts/partials/organizations/content.html deleted file mode 100644 index ea9983dd742affd07f3e657622511547926cd4d8..0000000000000000000000000000000000000000 --- a/layouts/partials/organizations/content.html +++ /dev/null @@ -1,9 +0,0 @@ -{{ if (partial "GetTextFromHTML" .Content) }} - <div itemprop="articleBody" class="rich-text"> - {{ - partial "PrepareHTML" ( - partial "H2AddId" .Content - ) - }} - </div> -{{ end }} diff --git a/layouts/partials/organizations/hero.html b/layouts/partials/organizations/hero.html index 3454341cfbf2cdff26319d8e3d29f12bbfe4600f..5013a73d83be7f66e8f5928ebfdbe341f6e340e7 100644 --- a/layouts/partials/organizations/hero.html +++ b/layouts/partials/organizations/hero.html @@ -2,5 +2,6 @@ (dict "title" .Title "image" .Params.image + "sizes" site.Params.image_sizes.sections.organizations.hero "context" . ) -}} diff --git a/layouts/partials/organizations/logo.html b/layouts/partials/organizations/logo.html index b4fff2e052ec8c51dcae0152ef6ce2b086b963ab..9d919c1b310b8e669e67e5af867acd0002428ccd 100644 --- a/layouts/partials/organizations/logo.html +++ b/layouts/partials/organizations/logo.html @@ -1,13 +1,10 @@ {{- if .Params.logo -}} <figure class="logo"> - <figcaption>{{ i18n "organizations.logo" }}</figcaption> {{- partial "commons/image.html" (dict "image" .Params.logo "alt" .Title - "mobile" "331" - "tablet" "196" - "desktop" "396" + "sizes" site.Params.image_sizes.sections.organizations.logo ) -}} </figure> {{- end -}} diff --git a/layouts/partials/organizations/organization.html b/layouts/partials/organizations/organization.html index 0891de6d8f82585dbc3afa5aa769041fd08a0d5d..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 -}} @@ -9,9 +9,7 @@ (dict "image" .Params.logo "alt" $title - "mobile" "144" - "tablet" "196" - "desktop" "176" + "sizes" site.Params.image_sizes.sections.organizations.item ) -}} {{- end -}} </div> diff --git a/layouts/partials/organizations/summary.html b/layouts/partials/organizations/summary.html new file mode 100644 index 0000000000000000000000000000000000000000..4ed5a570f5d60bc07d29393efb221e5fa06a7b8b --- /dev/null +++ b/layouts/partials/organizations/summary.html @@ -0,0 +1 @@ +{{- partial "commons/summary.html" . -}} diff --git a/layouts/partials/pages/chapo.html b/layouts/partials/pages/chapo.html deleted file mode 100644 index 4117ac68595d2f5ffaf25d0f39e028072afdbaab..0000000000000000000000000000000000000000 --- a/layouts/partials/pages/chapo.html +++ /dev/null @@ -1 +0,0 @@ -{{- partial "commons/chapo.html" . -}} diff --git a/layouts/partials/pages/children.html b/layouts/partials/pages/children.html index a028a1c42d7d0178c2ae5ce0d13244de60a74e4a..891d769c66d1ea8cee0da2a22400ff511fc94840 100644 --- a/layouts/partials/pages/children.html +++ b/layouts/partials/pages/children.html @@ -6,9 +6,7 @@ <div> {{ $page := partial "GetPageByUrl" . }} {{ with $page }} - {{ .Scratch.Set "show_description" true }} {{ partial "pages/page.html" . }} - {{ .Scratch.Delete "show_description" }} {{ end }} </div> {{ end }} diff --git a/layouts/partials/pages/hero.html b/layouts/partials/pages/hero.html index 8e7e675c055dce99ef4dda14b248d20db258f721..20039accd5cbb1a950cbf90da84190a01dfbb337 100644 --- a/layouts/partials/pages/hero.html +++ b/layouts/partials/pages/hero.html @@ -3,5 +3,6 @@ (dict "title" $title "image" .Params.image + "sizes" site.Params.image_sizes.sections.pages.hero "context" . ) -}} diff --git a/layouts/partials/pages/page-media.html b/layouts/partials/pages/page-media.html index 989f6d411d2b0e3601adbc9e557cb952df086dc5..1f6e6e063d9798a1990fd30e8ff43ace948b1847 100644 --- a/layouts/partials/pages/page-media.html +++ b/layouts/partials/pages/page-media.html @@ -3,9 +3,7 @@ {{- partial "commons/image.html" (dict "image" .Params.image - "mobile" "350x350" - "tablet" "400x400" - "desktop" "900x900" + "sizes" site.Params.image_sizes.sections.pages.item ) -}} {{- else -}} {{- partial "commons/image-default.html" -}} diff --git a/layouts/partials/pages/page.html b/layouts/partials/pages/page.html index 95cb478b218a6bbbf97212a9cc5b820feeb3d910..d2836679ee130bb6c47f718093b99d730d795c81 100644 --- a/layouts/partials/pages/page.html +++ b/layouts/partials/pages/page.html @@ -16,17 +16,8 @@ {{- partial "PrepareHTML" .Title -}} </a> {{- partial "PrepareHTML" (printf "</%s>" $heading) -}} - - {{- if .Scratch.Get "show_description" }} - {{- if .Params.description_short }} - <p>{{ partial "PrepareHTML" .Params.description_short }}</p> - {{ end -}} - {{ end -}} - {{- if .Scratch.Get "show_more" }} - <p class="more">{{- i18n "commons.more" -}}</p> + {{- if .Params.summary }} + <p>{{ partial "PrepareHTML" .Params.summary }}</p> {{ end -}} </div> - {{ if .Scratch.Get "show_image" }} - {{- partial "pages/page-media.html" . -}} - {{- end }} </article> diff --git a/layouts/partials/pages/pages.html b/layouts/partials/pages/pages.html index 48040bf6777cdc1e635d4c88127a1208fb7ce9ec..f78350bb1b5a0bba10f50f2e02f99cbbdb060dbd 100644 --- a/layouts/partials/pages/pages.html +++ b/layouts/partials/pages/pages.html @@ -1,9 +1,7 @@ <div class="pages"> {{ range .Paginator.Pages }} <div> - {{ .Scratch.Set "show_description" true }} {{ partial "pages/page.html" . }} - {{ .Scratch.Delete "show_description" }} </div> {{ end }} </div> diff --git a/layouts/partials/pages/summary.html b/layouts/partials/pages/summary.html new file mode 100644 index 0000000000000000000000000000000000000000..4ed5a570f5d60bc07d29393efb221e5fa06a7b8b --- /dev/null +++ b/layouts/partials/pages/summary.html @@ -0,0 +1 @@ +{{- partial "commons/summary.html" . -}} diff --git a/layouts/partials/persons/chapo.html b/layouts/partials/persons/chapo.html deleted file mode 100644 index 4117ac68595d2f5ffaf25d0f39e028072afdbaab..0000000000000000000000000000000000000000 --- a/layouts/partials/persons/chapo.html +++ /dev/null @@ -1 +0,0 @@ -{{- partial "commons/chapo.html" . -}} diff --git a/layouts/partials/persons/contact-details.html b/layouts/partials/persons/contact-details.html new file mode 100644 index 0000000000000000000000000000000000000000..134e1207be396c9d230d4276afa20b452a05f030 --- /dev/null +++ b/layouts/partials/persons/contact-details.html @@ -0,0 +1,51 @@ +{{ with .Params.contact_details }} + {{ if or .website .linkedin .twitter .email .phone }} + <div class="contacts-details contacts-details--person"> + {{ if or .website .linkedin .twitter .email .phone }} + <ul> + {{ with .website }} + <li> + <span>{{ i18n "commons.contact.website" }}</span> + <a href="{{ chomp .value }}" target="_blank" rel="noopener" itemprop="url">{{ chomp .label }}</a> + </li> + {{ end }} + + {{ with .linkedin }} + <li> + <span>LinkedIn</span> + <a href="{{ chomp .value }}" target="_blank" rel="noopener" itemprop="url">{{ chomp .label }}</a> + </li> + {{ end }} + + {{ with .mastodon }} + <li> + <span>Mastodon</span> + <a href="{{ chomp .value }}" target="_blank" rel="noopener" itemprop="url">{{ chomp .label }}</a> + </li> + {{ end }} + + {{ with .twitter }} + <li> + <span>Twitter</span> + <a href="{{ chomp .value }}" target="_blank" rel="noopener" itemprop="url">{{ chomp .label }}</a> + </li> + {{ end }} + + {{ with .email }} + <li> + <span>{{ i18n "commons.contact.email" }}</span> + <a href="{{ chomp .value }}" itemprop="email">{{ chomp .label }}</a> + </li> + {{ end }} + + {{ with .phone }} + <li> + <span>{{ i18n "commons.contact.phone" }}</span> + <a href="{{ .value }}" itemprop="telephone">{{ .label }}</a> + </li> + {{ end }} + </ul> + {{ end }} + </div> + {{ end }} +{{ end }} diff --git a/layouts/partials/persons/hero-single.html b/layouts/partials/persons/hero-single.html index 059d3e3d33d890fca775db786af6b12624d05784..37e4352768ca477695b29b538623fe1ef2058ffa 100644 --- a/layouts/partials/persons/hero-single.html +++ b/layouts/partials/persons/hero-single.html @@ -1,20 +1,29 @@ <header class="hero"> <div class="container"> - {{ partial "header/breadcrumbs.html" . }} + {{- if eq site.Params.breadcrumb.position "hero-start" -}} + {{ partial "header/breadcrumbs.html" . }} + {{- end -}} <div class="content"> <h1>{{ safeHTML (partial "CorrectPunctuation" .Title) }}</h1> {{ if .Params.image }} <div class="avatar"> {{ partial "commons/image.html" - (dict - "image" .Params.image - "class" "img-fluid" - "mobile" "202x202" - "tablet" "192x192" - "desktop" "400x400" - )}} + (dict + "image" .Params.image + "class" "img-fluid" + "sizes" site.Params.image_sizes.sections.persons.hero_single + )}} </div> {{ end }} </div> + {{- if eq site.Params.breadcrumb.position "hero-end" -}} + {{ partial "header/breadcrumbs.html" . }} + {{- end -}} </div> </header> + +{{- if eq site.Params.breadcrumb.position "after-hero" -}} + <div class="container"> + {{ partial "header/breadcrumbs.html" . }} + </div> +{{- end -}} \ No newline at end of file diff --git a/layouts/partials/persons/hero.html b/layouts/partials/persons/hero.html index 8e7e675c055dce99ef4dda14b248d20db258f721..c346f266db90bced536227bcca93244d15663127 100644 --- a/layouts/partials/persons/hero.html +++ b/layouts/partials/persons/hero.html @@ -4,4 +4,5 @@ "title" $title "image" .Params.image "context" . + "sizes" site.Params.image_sizes.sections.persons.hero ) -}} diff --git a/layouts/partials/persons/image.html b/layouts/partials/persons/image.html deleted file mode 100644 index c31b7b9b8812fd227eb3ee1506d52fc3aa769528..0000000000000000000000000000000000000000 --- a/layouts/partials/persons/image.html +++ /dev/null @@ -1,17 +0,0 @@ -{{ if . }} - <figure class="featured-image"> - {{ partial "commons/image.html" - (dict - "image" . - "mobile" "351x168" - "tablet" "456x219" - "desktop" "1232x450" - "itemprop" true - )}} - {{- if isset . "credit" -}} - {{ if partial "GetTextFromHTML" .credit }} - <figcaption>{{ partial "PrepareHTML" .credit }}</figcaption> - {{ end }} - {{- end -}} - </figure> -{{ end }} diff --git a/layouts/partials/persons/list-item.html b/layouts/partials/persons/list-item.html index f6e349ec569733faddc853b587e1bc0a7e56589a..327244c7b3c7a14308f218752105c61f0b9cdd65 100644 --- a/layouts/partials/persons/list-item.html +++ b/layouts/partials/persons/list-item.html @@ -1,6 +1,6 @@ <li itemscope itemtype="https://schema.org/Person"> <p itemprop="name"><a href="{{ .Permalink }}">{{ partial "PrepareHTML" .Title }}</a></p> - {{- if partial "GetTextFromHTML" .Params.description_short }} - <p itemprop="jobTitle">{{- partial "PrepareHTML" .Params.description_short -}}</p> + {{- if partial "GetTextFromHTML" .Params.summary }} + <p itemprop="jobTitle">{{- partial "PrepareHTML" .Params.summary -}}</p> {{ end -}} </li> \ No newline at end of file diff --git a/layouts/partials/persons/list-specific.html b/layouts/partials/persons/list-specific.html index 605023a4f10c726621c7c081a1e33b090111f451..5b02131199e42a106ec97089acbda7f3f2d41e7b 100644 --- a/layouts/partials/persons/list-specific.html +++ b/layouts/partials/persons/list-specific.html @@ -1,14 +1,14 @@ -<ol class="persons"> - {{ range (.Paginate (.Pages.ByParam "last_name")).Pages }} - {{ if .Slug }} - {{ $slug := printf "/persons/%s" .Slug }} - {{ $person := site.GetPage $slug }} - {{ if $person }} - {{ with $person }} - {{ partial "persons/list-item" $person }} - {{ end }} - {{ end }} +{{ $persons := slice }} + +{{ range (.Paginate (.Pages.ByParam "last_name")).Pages }} + {{ if .Slug }} + {{ $slug := printf "/persons/%s" .Slug }} + {{ $person := site.GetPage $slug }} + {{ if $person }} + {{ $persons = $persons | append $person }} {{ end }} {{ end }} -</ol> +{{ end }} + +{{ partial "persons/list.html" (dict "persons" $persons) }} {{ partial "commons/pagination.html" . }} diff --git a/layouts/partials/persons/list.html b/layouts/partials/persons/list.html index 77a53118ffd00784b31fcfd602c7e429608f53a1..9edc780d68ca0968021de3851db7f69bbca2fa4f 100644 --- a/layouts/partials/persons/list.html +++ b/layouts/partials/persons/list.html @@ -1,7 +1,13 @@ -<ol class="persons"> - {{ $persons := .Pages.ByParam "last_name" }} - {{ range (.Paginate $persons).Pages }} - {{ partial "persons/list-item" . }} - {{ end }} -</ol> -{{ partial "commons/pagination.html" . }} +{{ if eq site.Params.persons.index.layout "list" }} + <ol class="persons persons--list"> + {{ range .persons }} + {{ partial "persons/list-item" . }} + {{ end }} + </ol> +{{ else if eq site.Params.persons.index.layout "grid" }} + <div class="persons"> + {{ range .persons }} + {{ partial "persons/person" . }} + {{ end }} + </div> +{{ end }} diff --git a/layouts/partials/persons/person.html b/layouts/partials/persons/person.html index 0047e2e5e49e65772f5424dd8b76a060bb31ecab..6d48c7f950269ccceb868168f5f82d08f365b20b 100644 --- a/layouts/partials/persons/person.html +++ b/layouts/partials/persons/person.html @@ -2,8 +2,8 @@ <div class="description"> {{- $title := partial "PrepareHTML" .Title }} <p class="name"><a href="{{ .Permalink }}">{{- $title -}}</a></p> - {{- if partial "GetTextFromHTML" .Params.description_short }} - <p>{{- partial "PrepareHTML" .Params.description_short -}}</p> + {{- if partial "GetTextFromHTML" .Params.summary }} + <p>{{- partial "PrepareHTML" .Params.summary -}}</p> {{ else if (partial "GetTextFromHTML" .Content) }} <p>{{- partial "GetTruncateContent" ( dict "text" .Content ) -}}</p> {{ end -}} @@ -12,11 +12,9 @@ {{- if .Params.image }} {{ partial "commons/image.html" (dict - "alt" .Title + "alt" .Title "image" .Params.image - "mobile" "80x80" - "tablet" "100x100" - "desktop" "255x255" + "sizes" site.Params.image_sizes.sections.persons.item )}} {{ end -}} </div> diff --git a/layouts/partials/persons/posts.html b/layouts/partials/persons/posts.html index 0e5c05cca36ed218b79c37422121d287db04139b..d31f1bf3966e345ed754aae10f168c40e0aaafa4 100644 --- a/layouts/partials/persons/posts.html +++ b/layouts/partials/persons/posts.html @@ -2,9 +2,9 @@ <div class="top"> <h2 class="h5"><a href="{{ .Permalink }}">{{ i18n "persons.posts" }}</a></h2> </div> - <div class="posts"> + <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/persons/summary.html b/layouts/partials/persons/summary.html new file mode 100644 index 0000000000000000000000000000000000000000..4ed5a570f5d60bc07d29393efb221e5fa06a7b8b --- /dev/null +++ b/layouts/partials/persons/summary.html @@ -0,0 +1 @@ +{{- partial "commons/summary.html" . -}} diff --git a/layouts/partials/posts/block-posts-layout.html b/layouts/partials/posts/block-posts-layout.html new file mode 100644 index 0000000000000000000000000000000000000000..fad22521e80f720f7c858635bf4b39b643d2e5e1 --- /dev/null +++ b/layouts/partials/posts/block-posts-layout.html @@ -0,0 +1,15 @@ +{{ $layout := site.Params.posts.index.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.html" (dict + "post" . + "heading" "h3" + ) }} + {{ end }} + </div> + </div> + </div> +</div> \ No newline at end of file diff --git a/layouts/partials/posts/chapo.html b/layouts/partials/posts/chapo.html deleted file mode 100644 index 4117ac68595d2f5ffaf25d0f39e028072afdbaab..0000000000000000000000000000000000000000 --- a/layouts/partials/posts/chapo.html +++ /dev/null @@ -1 +0,0 @@ -{{- partial "commons/chapo.html" . -}} diff --git a/layouts/partials/posts/hero-list.html b/layouts/partials/posts/hero-list.html index 3454341cfbf2cdff26319d8e3d29f12bbfe4600f..fa8d44876816599205324c8c4e9c2813d3455d01 100644 --- a/layouts/partials/posts/hero-list.html +++ b/layouts/partials/posts/hero-list.html @@ -2,5 +2,6 @@ (dict "title" .Title "image" .Params.image + "sizes" site.Params.image_sizes.sections.posts.hero "context" . ) -}} diff --git a/layouts/partials/posts/hero-single.html b/layouts/partials/posts/hero-single.html index 3454341cfbf2cdff26319d8e3d29f12bbfe4600f..c872372aaecd8f79af38325966ff5c750001b4f1 100644 --- a/layouts/partials/posts/hero-single.html +++ b/layouts/partials/posts/hero-single.html @@ -2,5 +2,6 @@ (dict "title" .Title "image" .Params.image + "sizes" site.Params.image_sizes.sections.posts.hero_single "context" . ) -}} diff --git a/layouts/partials/posts/image.html b/layouts/partials/posts/image.html deleted file mode 100644 index eb398d084b434d3b76847294e820fba650f2d982..0000000000000000000000000000000000000000 --- a/layouts/partials/posts/image.html +++ /dev/null @@ -1,17 +0,0 @@ -{{ if . }} - <figure class="featured-image"> - {{ partial "commons/image.html" - (dict - "image" . - "mobile" "350x350" - "tablet" "450x450" - "desktop" "900x900" - "itemprop" true - )}} - {{- if isset . "credit" -}} - {{ if partial "GetTextFromHTML" .credit }} - <figcaption>{{ partial "PrepareHTML" .credit }}</figcaption> - {{ end }} - {{- end -}} - </figure> -{{ end }} diff --git a/layouts/partials/posts/post.html b/layouts/partials/posts/post.html index 1168ce5d86f502d865058496d3d6d55ee32168ca..10cdc4cb563b993e03bf929606d4cc6953992840 100644 --- a/layouts/partials/posts/post.html +++ b/layouts/partials/posts/post.html @@ -1,18 +1,30 @@ +{{ $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> - {{ if $.Site.Params.posts.list.show_categories }} + + {{ $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 }} - {{- if (partial "GetTextFromHTML" .Params.description_short) -}} - {{ if $.Site.Params.posts.list.truncate_description }} + {{- if (partial "GetTextFromHTML" .Params.summary) -}} + {{ if $.Site.Params.posts.index.truncate_description }} <p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict - "text" .Params.description_short - "length" $.Site.Params.posts.list.truncate_description + "text" .Params.summary + "length" $.Site.Params.posts.index.truncate_description ) }}</p> {{ else }} - <p itemprop="articleBody">{{ partial "PrepareHTML" .Params.description_short }}</p> + <p itemprop="articleBody">{{ partial "PrepareHTML" .Params.summary }}</p> {{ end }} {{- end -}} @@ -23,12 +35,11 @@ {{- partial "commons/image.html" (dict "image" .Params.image - "mobile" "350x350" - "tablet" "450x450" - "desktop" "900x900" + "sizes" site.Params.image_sizes.sections.posts.item ) -}} {{- else -}} {{- partial "commons/image-default.html" -}} {{- 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 7a0a4cfda055f218e77bd5b1d144bebcca1550a8..f3304c7f7a74ba95a78647d0ef7233213b13e7bc 100644 --- a/layouts/partials/posts/posts.html +++ b/layouts/partials/posts/posts.html @@ -1,8 +1,8 @@ -<div class="posts"> +<div class="posts posts--{{- site.Params.posts.index.layout -}}"> {{ if not .Pages }} <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/posts/prevnext.html b/layouts/partials/posts/prevnext.html index 0f311366872262f104916204b35b3f76d9f61e9e..ea558c4da954391c6d01c7742e113dfedd4c92ca 100644 --- a/layouts/partials/posts/prevnext.html +++ b/layouts/partials/posts/prevnext.html @@ -1,30 +1,38 @@ -<nav class="posts-navigation" aria-label="{{ i18n "commons.pagination.between.posts" }}"> - <ul> - {{- if .PrevInSection -}} - {{with .Site.RegularPages.Prev . }} - <li class="previous"> - {{ $title := partial "PrepareHTML" .Title -}} - <a href="{{.RelPermalink}}" title="{{ safeHTML (i18n "posts.previous_aria" (dict "Title" $title)) }}"> - <span> - {{- i18n "posts.previous" -}} - </span> - {{- $title -}} - </a> - </li> - {{end}} - {{- end -}} - {{- if .NextInSection -}} - {{with .Site.RegularPages.Next . }} - <li class="next"> - {{ $title := partial "PrepareHTML" .Title -}} - <a href="{{.RelPermalink}}" title="{{ safeHTML (i18n "posts.next_aria" (dict "Title" $title)) }}"> - <span> - {{- i18n "posts.next" -}} - </span> - {{- $title -}} - </a> - </li> - {{end}} - {{- end -}} - </ul> -</nav> +{{- if or .PrevInSection .NextInSection -}} +<div class="block block-pagination"> + <div class="container"> + <div class="block-content"> + <nav class="posts-navigation" aria-label="{{ i18n "commons.pagination.between.posts" }}"> + <ul> + {{- if .PrevInSection -}} + {{with .Site.RegularPages.Prev . }} + <li class="previous"> + {{ $title := partial "PrepareHTML" .Title -}} + <a href="{{.RelPermalink}}" title="{{ safeHTML (i18n "posts.previous_aria" (dict "Title" $title)) }}"> + <span> + {{- i18n "posts.previous" -}} + </span> + {{- $title -}} + </a> + </li> + {{end}} + {{- end -}} + {{- if .NextInSection -}} + {{with .Site.RegularPages.Next . }} + <li class="next"> + {{ $title := partial "PrepareHTML" .Title -}} + <a href="{{.RelPermalink}}" title="{{ safeHTML (i18n "posts.next_aria" (dict "Title" $title)) }}"> + <span> + {{- i18n "posts.next" -}} + </span> + {{- $title -}} + </a> + </li> + {{end}} + {{- end -}} + </ul> + </nav> + </div> + </div> +</div> +{{- end -}} 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/posts/summary.html b/layouts/partials/posts/summary.html new file mode 100644 index 0000000000000000000000000000000000000000..4ed5a570f5d60bc07d29393efb221e5fa06a7b8b --- /dev/null +++ b/layouts/partials/posts/summary.html @@ -0,0 +1 @@ +{{- partial "commons/summary.html" . -}} diff --git a/layouts/partials/programs/chapo.html b/layouts/partials/programs/chapo.html deleted file mode 100644 index 4117ac68595d2f5ffaf25d0f39e028072afdbaab..0000000000000000000000000000000000000000 --- a/layouts/partials/programs/chapo.html +++ /dev/null @@ -1 +0,0 @@ -{{- partial "commons/chapo.html" . -}} diff --git a/layouts/partials/programs/chapters.html b/layouts/partials/programs/chapters.html deleted file mode 100644 index 4e208f716408efd75e77ac05abff3386f79035c1..0000000000000000000000000000000000000000 --- a/layouts/partials/programs/chapters.html +++ /dev/null @@ -1,30 +0,0 @@ -<div itemprop="articleBody"> - {{- $params := .params -}} - {{- $contactsExist := or $params.contacts $params.roles -}} - {{- range .chapters -}} - {{- $content := index $params . -}} - {{- $chapterExists := $content -}} - {{ if eq "contacts" . }} - {{- $chapterExists = $contactsExist -}} - {{ end }} - {{- if $chapterExists }} - <section> - {{ $title := i18n (printf "programs._%s" .) -}} - <h2 id="page-{{ . }}">{{ $title }}</h2> - {{ if eq . "contacts" }} - {{- partial "programs/content.html" $content -}} - {{- partial "programs/roles.html" $params.roles -}} - {{ else if eq . "teachers" }} - {{- partial "programs/teachers.html" - (dict - "title" $title - "teachers" $params.teachers - "descriptions" $params.teachers_description - ) -}} - {{ else }} - {{- partial "programs/content.html" $content -}} - {{ end }} - </section> - {{ end -}} - {{- end -}} -</div> diff --git a/layouts/partials/programs/hero.html b/layouts/partials/programs/hero.html index 8e7e675c055dce99ef4dda14b248d20db258f721..ee3cfeb3732d99ad494f13510722df71d651f50b 100644 --- a/layouts/partials/programs/hero.html +++ b/layouts/partials/programs/hero.html @@ -3,5 +3,6 @@ (dict "title" $title "image" .Params.image + "sizes" site.Params.image_sizes.sections.programs.hero "context" . ) -}} diff --git a/layouts/partials/programs/image.html b/layouts/partials/programs/image.html index a6bc76f50a5002cc60c14dcb57d452d641298e66..5774db7cab06dd34b1fb3f0092b40fb20885a2aa 100644 --- a/layouts/partials/programs/image.html +++ b/layouts/partials/programs/image.html @@ -3,9 +3,7 @@ {{ partial "commons/image.html" (dict "image" . - "mobile" "351x168" - "tablet" "456x219" - "desktop" "856x410" + "sizes" site.Params.image_sizes.sections.programs.image "itemprop" true "crop" true )}} diff --git a/layouts/partials/programs/list.html b/layouts/partials/programs/list.html index 9e9a9b831ff9465a7bb4258a447ea0cc611b8b83..5184794ca527a4520209dede83f209ceaf307ca1 100644 --- a/layouts/partials/programs/list.html +++ b/layouts/partials/programs/list.html @@ -5,7 +5,7 @@ "context" . ) }} - {{ partial "programs/chapo.html" (dict + {{ partial "programs/summary.html" (dict "with_container" true "context" . ) }} diff --git a/layouts/partials/programs/program.html b/layouts/partials/programs/program.html index 7efa8afb76d15ada3db0b4e0fbd23402ba710045..caa4fd805e6724997644b30253e191658b4eb909 100644 --- a/layouts/partials/programs/program.html +++ b/layouts/partials/programs/program.html @@ -1,31 +1,13 @@ -{{- $with_image := false -}} -{{- if .Scratch.Get "with_image" -}} - {{- $with_image = true -}} -{{- end -}} {{- $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 }} </div> - {{- if $with_image }} - {{- if .Params.image }} - <div class="media"> - {{ partial "commons/image.html" - (dict - "image" .Params.image - "mobile" "351x168" - "tablet" "456x219" - "desktop" "856x410" - "itemprop" true - )}} - </div> - {{ end -}} - {{ end -}} </article> diff --git a/layouts/partials/programs/programs-list.html b/layouts/partials/programs/programs-list.html index c718510e869aa23f7dc024bf08221b110ac2db63..92575e9dc28bff473f01eafc5aea53e48e1ca5a7 100644 --- a/layouts/partials/programs/programs-list.html +++ b/layouts/partials/programs/programs-list.html @@ -9,6 +9,7 @@ {{- with .Params.diplomas -}} {{- $diploma := site.GetPage (printf "/diplomas/%s" .) -}} {{- with $diploma -}} +   <a href="{{ .Permalink }}" title="{{ partial "PrepareHTML" .Title }}">{{ partial "PrepareHTML" .Params.short_name }}</a> {{- end -}} {{- end -}} diff --git a/layouts/partials/programs/related.html b/layouts/partials/programs/related.html new file mode 100644 index 0000000000000000000000000000000000000000..0c0dd60f2f63bcb9444e64fcac2ecdece1e2d607 --- /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/roles.html b/layouts/partials/programs/roles.html deleted file mode 100644 index 0fa6b0b5a37a761ea63415e1aa3cd9acdbf55c04..0000000000000000000000000000000000000000 --- a/layouts/partials/programs/roles.html +++ /dev/null @@ -1,29 +0,0 @@ -{{- range . }} - <h3>{{ .title }}</h3> - <div class="persons"> - {{- range .persons -}} - {{ $slug := . }} - {{ with site.GetPage "persons" }} - {{ with .GetPage $slug }} - <div> - <div class="person"> - <p class="name"> - <a href="{{ .Permalink }}">{{ partial "PrepareHTML" .Title }}</a> - </p> - {{ if .Params.email }} - <p class="contact"> - <a href="mailto:{{ .Params.email }}" rel="noreferrer" target="_blank">{{ .Params.email }}</a> - </p> - {{ end }} - {{ if .Params.phone }} - <p class="contact"> - {{ safeHTML .Params.phone }} - </p> - {{ end }} - </div> - </div> - {{ end }} - {{ end }} - {{ end }} - </div> -{{ end -}} diff --git a/layouts/partials/programs/single.html b/layouts/partials/programs/single.html index 0edaa290bc9dd2d9a40a9756c9c70207934a5a26..2f00aa72b95f95ebffad72b86fad1f61a041be26 100644 --- a/layouts/partials/programs/single.html +++ b/layouts/partials/programs/single.html @@ -25,19 +25,19 @@ {{- end -}} {{- end -}} - {{ partial "programs/chapo.html" (dict + {{ partial "programs/summary.html" (dict "with_container" true "context" . ) }} + {{- partial "programs/presentation.html" . -}} {{- partial "programs/children.html" .Pages -}} {{- partial "programs/pedagogy.html" . -}} {{- 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/summary.html b/layouts/partials/programs/summary.html new file mode 100644 index 0000000000000000000000000000000000000000..4ed5a570f5d60bc07d29393efb221e5fa06a7b8b --- /dev/null +++ b/layouts/partials/programs/summary.html @@ -0,0 +1 @@ +{{- partial "commons/summary.html" . -}} 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> diff --git a/layouts/partials/sitemap/document-nav.html b/layouts/partials/sitemap/document-nav.html deleted file mode 100644 index 0b722516ff055ca9fa3011ff667c437489cc81cb..0000000000000000000000000000000000000000 --- a/layouts/partials/sitemap/document-nav.html +++ /dev/null @@ -1,5 +0,0 @@ -<div class="document-nav"> - <div> - {{- partial "sitemap/toc.html" . -}} - </div> -</div> \ No newline at end of file diff --git a/layouts/partials/sitemap/summary.html b/layouts/partials/sitemap/summary.html new file mode 100644 index 0000000000000000000000000000000000000000..4ed5a570f5d60bc07d29393efb221e5fa06a7b8b --- /dev/null +++ b/layouts/partials/sitemap/summary.html @@ -0,0 +1 @@ +{{- partial "commons/summary.html" . -}} diff --git a/layouts/partials/sitemap/toc.html b/layouts/partials/sitemap/toc.html index 49a56588ba823b9ecde52462a812f1e0f2ba04da..8f82e88ef95831d065d81946b0a6376e6fe10cd4 100644 --- a/layouts/partials/sitemap/toc.html +++ b/layouts/partials/sitemap/toc.html @@ -1,5 +1,8 @@ -<nav class="toc" id="nav-toc" aria-label="Table des matières"> +<nav class="toc" id="nav-toc" aria-label="{{ i18n "commons.toc" }}"> <ol> + {{- if .context.Params.blocks -}} + {{- partial "blocks/toc.html" .context.Params.blocks -}} + {{- end -}} {{ range site.Sections }} {{ if ne .Type "sitemap" }} <li> diff --git a/layouts/partials/volumes/hero.html b/layouts/partials/volumes/hero.html index 3454341cfbf2cdff26319d8e3d29f12bbfe4600f..a7648499f62496bc2d3870e5e7650040c691efde 100644 --- a/layouts/partials/volumes/hero.html +++ b/layouts/partials/volumes/hero.html @@ -2,5 +2,6 @@ (dict "title" .Title "image" .Params.image + "sizes" site.Params.image_sizes.sections.volumes.hero "context" . ) -}} diff --git a/layouts/partials/volumes/image.html b/layouts/partials/volumes/image.html deleted file mode 100644 index 38e5d66e5a1e63647a3b28a4f62b09edaf643ab2..0000000000000000000000000000000000000000 --- a/layouts/partials/volumes/image.html +++ /dev/null @@ -1,13 +0,0 @@ -{{- if .Params.image -}} - <div> - {{- partial "commons/image.html" - (dict - "image" .Params.image - "alt" .Title - "mobile" "327x388" - "tablet" "208x247" - "desktop" "300x356" - "class" "img-fluid" - ) -}} - </div> -{{- end -}} diff --git a/layouts/partials/volumes/volume.html b/layouts/partials/volumes/volume.html index 359caf279bd01f8df468d628293ff6f4f8897792..09fc5ab2605b899b1e1740affcca93017e9c33d9 100644 --- a/layouts/partials/volumes/volume.html +++ b/layouts/partials/volumes/volume.html @@ -9,9 +9,7 @@ (dict "image" .Params.image "alt" .Title - "mobile" "327x388" - "tablet" "208x247" - "desktop" "408x485" + "sizes" site.Params.image_sizes.sections.volumes.item ) -}} {{- else if site.Params.default_image.url -}} {{- partial "commons/image-default.html" (dict "class" "img-fluid") -}} diff --git a/layouts/persons/list.html b/layouts/persons/list.html index e43671cf654ae58124230cdbc544f9a52387b7fb..c40bba59311fa0d850ab0caef7aad847fd4b9312 100644 --- a/layouts/persons/list.html +++ b/layouts/persons/list.html @@ -17,27 +17,31 @@ ) }} - {{ $chapo_block := false }} + {{ $summary_block := false }} {{ if .Params.blocks }} {{ if gt (len .Params.blocks) 1 }} - {{ $chapo_block = true }} + {{ $summary_block = true }} {{ end }} {{ end }} - {{ partial "persons/chapo.html" (dict + + {{ partial "persons/summary.html" (dict "context" . - "with_container" (not $chapo_block) - "block_wrapped" $chapo_block + "with_container" (not $summary_block) + "block_wrapped" $summary_block ) }} + {{ partial "blocks/list.html" . }} + <div class="container"> {{- if not $is_organigram_present -}} {{ partial "persons/taxonomies.html" . }} - {{ partial "persons/list.html" . }} + {{ $persons := .Pages.ByParam "last_name" }} + {{ $persons = (.Paginate $persons).Pages }} + {{ partial "persons/list.html" (dict "persons" $persons) }} + {{ partial "commons/pagination.html" . }} {{- end -}} </div> - - {{ partial "blocks/list.html" . }} </div> {{ end }} diff --git a/layouts/persons/single.html b/layouts/persons/single.html index 9c4246b17517ac6f18d5b305431d72ac06629aa4..af7ba655f7def355827d4da56049be80cdfad625 100644 --- a/layouts/persons/single.html +++ b/layouts/persons/single.html @@ -35,9 +35,9 @@ <div class="informations"> <div> - {{ if (partial "GetTextFromHTML" .Params.description_short) }} + {{ if (partial "GetTextFromHTML" .Params.summary) }} <div class="lead" itemprop="description"> - {{ partial "PrepareHTML" .Params.description_short }} + {{ partial "PrepareHTML" .Params.summary }} </div> {{ end }} {{ if (partial "GetTextFromHTML" .Content) }} @@ -61,6 +61,9 @@ </div> {{ end }} </div> + + {{ partial "persons/contact-details.html" . }} + </div> {{ partial "blocks/list.html" . }} diff --git a/layouts/posts/list.html b/layouts/posts/list.html index 412cd96e03fc2779568440831a50a6cdda0d1f87..e01334c9d5becc1e702be90dc25495f04439d7a8 100644 --- a/layouts/posts/list.html +++ b/layouts/posts/list.html @@ -3,7 +3,7 @@ <div class="document-content"> {{ partial "commons/list-content.html" . }} - {{ partial "posts/chapo.html" (dict + {{ partial "posts/summary.html" (dict "with_container" true "context" . ) }} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 0e573f78b00dbb7971c4c744520fbd05e75f91d4..4be3de9bad1ff5bb728b164ace32720386f5ac90 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -5,25 +5,19 @@ <meta itemprop="headline" content="{{ partial "PrepareHTML" .Title }}"> <meta itemprop="url" content="{{ .Permalink }}"> {{ if .Date }}<meta itemprop="datePublished" content="{{ .Date.Format "2006-01-02T15:04" }}">{{ end }} - {{ if .Params.description_short }}<meta itemprop="abstract" content="{{ partial "PrepareHTML" .Params.description_short }}">{{ end }} + {{ if .Params.summary }}<meta itemprop="abstract" content="{{ partial "PrepareHTML" .Params.summary }}">{{ end }} {{ if .Summary }}<meta itemprop="description" content="{{ partial "PrepareHTML" .Summary }}">{{ end }} {{ partial "posts/sidebar.html" . }} - {{ partial "posts/chapo.html" (dict + {{ partial "posts/summary.html" (dict "context" . "block_wrapped" true ) }} {{ partial "blocks/list.html" . }} - <div class="block block-pagination"> - <div class="container"> - <div class="block-content"> - {{ partial "posts/prevnext.html" . }} - </div> - </div> - </div> + {{ partial "posts/prevnext.html" . }} {{ partial "hooks/before-document-content-end.html" . }} </div> diff --git a/layouts/researchers/list.html b/layouts/researchers/list.html index 95ad4b7ae3170609d67b1565f4bfa4cc833fa556..a7e18fc72ea9cf679e56e3421be244b4c49a935e 100644 --- a/layouts/researchers/list.html +++ b/layouts/researchers/list.html @@ -4,7 +4,7 @@ <div class="document-content"> - {{ partial "persons/chapo.html" (dict + {{ partial "persons/summary.html" (dict "with_container" true "context" . ) }} diff --git a/layouts/sitemap/list.html b/layouts/sitemap/list.html deleted file mode 100644 index fe90eda7eef2795dd2920d1820ee7418e98e0c39..0000000000000000000000000000000000000000 --- a/layouts/sitemap/list.html +++ /dev/null @@ -1,30 +0,0 @@ -{{ define "main" }} - {{- partial "header/hero.html" - (dict - "title" .Title - "image" .Params.image - "context" . - ) -}} - <div class="document-content container"> - <div class="content"> - {{- partial "sitemap/document-nav" . -}} - <div> - {{ range site.Sections }} - {{ if ne .Type "sitemap" }} - {{ $permalink := .Permalink }} - <h3 id="{{ .Type }}"> - <a href="{{ $permalink }}">{{ safeHTML .Title }}</a> - </h3> - <ul> - {{ range where .Site.Pages "Section" .Type }} - {{ if ne $permalink .Permalink }} - <li><a href="{{ .Permalink }}">{{ safeHTML .Title }}</a></li> - {{ end }} - {{ end }} - </ul> - {{ end }} - {{ end }} - </div> - </div> - </div> -{{ end }} diff --git a/layouts/teachers/list.html b/layouts/teachers/list.html index c9078e727c0e5db7c8d4bcde875a5331ad426bb9..64d780d483a76930c4c1706fe5045d0dc82ef185 100644 --- a/layouts/teachers/list.html +++ b/layouts/teachers/list.html @@ -4,7 +4,7 @@ <div class="document-content"> - {{ partial "persons/chapo.html" (dict + {{ partial "persons/summary.html" (dict "with_container" true "context" . ) }} diff --git a/static/osuny-theme-version b/static/osuny-theme-version index 149ed370a930a6b31b0ab7ffde75e167e62ebe6b..9539b9db87be7cb2b2d91477be31fbbd0e59ec94 100644 --- a/static/osuny-theme-version +++ b/static/osuny-theme-version @@ -1 +1 @@ -v3.0.6 \ No newline at end of file +v3.0.12 \ No newline at end of file diff --git a/static/site.webmanifest b/static/site.webmanifest new file mode 100644 index 0000000000000000000000000000000000000000..fd16e9c05ccb40afefc5c4a404aec21a5c3f292a --- /dev/null +++ b/static/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/assets/images/favicons/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/assets/images/favicons/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +}