diff --git a/assets/js/theme/blocks/draggableBlocks.js b/assets/js/theme/blocks/draggableBlocks.js new file mode 100644 index 0000000000000000000000000000000000000000..fcde80907af054d6068d5a757e9358fadcd7e148 --- /dev/null +++ b/assets/js/theme/blocks/draggableBlocks.js @@ -0,0 +1,170 @@ +const draggableBlocks = document.querySelectorAll('.block-timeline--horizontal, .block-posts--carousel'); + +class DraggableBlock { + constructor (block) { + this.block = block; + this.content = this.block.querySelector('.draggable-container'); + this.list = this.block.querySelector('ol, ul'); + this.items = this.list.querySelectorAll('.draggable-item'); + this.previous = this.block.querySelector('.previous'); + this.next = this.block.querySelector('.next'); + this.isPointerDown = false; + + this.index = 0; + + this.listen(); + this.resize(); + this.goTo(0); + } + + listen () { + window.addEventListener('resize', this.resize.bind(this)); + + this.items.forEach((item, i) => { + item.addEventListener('click', this.onClickItem.bind(this, i)); + }); + + if (this.previous && this.next) { + this.handleArrows(); + } + + this.handlePointers(); + this.handleScroll(); + } + + resize () { + let maxTitleHeight = 0; + + this.block.style = ''; + + this.itemWidth = this.items[0].offsetWidth; + + this.items.forEach((item) => { + maxTitleHeight = Math.max(item.querySelector('.title, [itemprop="headline"]').offsetHeight, maxTitleHeight); + }); + + this.block.style.setProperty('--min-title-height', maxTitleHeight + 'px'); + this.update(); + } + + onClickItem(i) { + if (!this.isManipulated) { + this.goTo(i); + } + } + + handleArrows () { + this.previous.addEventListener('click', () => { + this.goTo(this.index-1); + }); + + this.next.addEventListener('click', () => { + this.goTo(this.index+1); + }); + } + + handlePointers () { + let startX, + endX, + threshold = 30; + // j'ai initialisé isPointerDown au début du code : this.isPointerDown + // j'ai enlevé endEvents = ['pointerup'] parce qu'il était seul ? + this.block.style.touchAction = 'pan-y'; + + // on passe de this.content à this.block sur chaque événement pour grab sur tout le bloc + this.block.addEventListener('pointerdown', (event) => { + // On vérifie que l'on ne soit pas en train de cliquer sur les boutons (car on cible tout le bloc pour le grab) + if (event.target !== this.next && event.target !== this.previous) { + // on utilise partout this.isPointerDown car la navigation avec les arrow buguait + // parfois ça naviguait de 2 items + this.isPointerDown = true; + this.content.classList.add('is-grabbing'); + startX = event.clientX; + } + }); + + this.block.addEventListener('pointermove', (event) => { + endX = event.clientX; + // On vérifie que l'événement pointerdown a été activé + if (this.isPointerDown) { + event.preventDefault(); + this.items.forEach((item) => { + // on enlève le pointerevents pour que les liens ne soient pas cliquable au drag + item.style.pointerEvents = "none"; + }); + } + }); + + // anciennement géré avec endEvents = ['pointerup'] (j'enlève le forEach) + this.block.addEventListener('pointerup', (event) => { + endX = event.clientX; + // on vérifie encore isPointerDown pour éviter le pb des arrows + if (this.isPointerDown) { + this.isPointerDown = false; + this.onManipulationEnd(startX, endX, threshold); + } + }); + } + + handleScroll() { + // On écoute le scroll sur le contenu du bloc + this.content.addEventListener('wheel', (event) => { + const deltaX = event.deltaX; + const deltaY = event.deltaY; + // navigation entre les items (comme onManipulationEnd) + if (Math.abs(deltaX) > Math.abs(deltaY)) { + if (deltaX !== 0) { + if (deltaX > 0) { + this.goTo(this.index + 1); + } else { + this.goTo(this.index - 1); + } + } + } + }); + } + + onManipulationEnd (start, end, threshold) { + if (start > end + threshold) { + this.goTo(this.index+1); + } else if (start < end - threshold) { + this.goTo(this.index-1); + } + + this.content.classList.remove('is-grabbing'); + this.items.forEach((item) => { + // On rend le pointervents pour pouvoir cliquer sur le lien si on drag pas + item.style.pointerEvents = "all"; + }); + + setTimeout(() => { + this.isManipulated = false; + }, 100); + } + + goTo (_index) { + this.index = Math.min(Math.max(_index, 0), this.items.length-1); + this.update(); + } + + update () { + this.list.style.marginLeft = `${-this.index * this.itemWidth}px`; + + this.items.forEach((item, index) => { + if (index < this.index) { + item.classList.add('is-passed'); + } else { + item.classList.remove('is-passed'); + } + }); + + if (this.previous && this.next) { + this.previous.disabled = this.index === 0; + this.next.disabled = this.index === this.items.length - 1; + } + } +} + +draggableBlocks.forEach((block) => { + new DraggableBlock(block); +}); diff --git a/assets/js/theme/blocks/timeline.js b/assets/js/theme/blocks/timeline.js deleted file mode 100644 index bf8b9ac97730155bc496a8aa790628f7cc4f825e..0000000000000000000000000000000000000000 --- a/assets/js/theme/blocks/timeline.js +++ /dev/null @@ -1,132 +0,0 @@ -const timelines = document.querySelectorAll('.block-timeline--horizontal'); - -class BlockTimeline { - constructor (block) { - this.block = block; - this.content = this.block.querySelector('.timeline'); - this.list = this.block.querySelector('.timeline-events ol'); - this.items = this.list.querySelectorAll('.timeline-event'); - this.previous = this.block.querySelector('.previous'); - this.next = this.block.querySelector('.next'); - this.isManipulated = false; - - this.index = 0; - - this.listen(); - this.resize(); - this.goTo(0); - } - - listen () { - window.addEventListener('resize', this.resize.bind(this)); - - this.items.forEach((item, i) => { - item.addEventListener('click', this.onClickItem.bind(this, i)); - }); - - if (this.previous && this.next) { - this.handleArrows(); - } - - this.handlePointers(); - } - - resize () { - let maxTitleHeight = 0; - - this.block.style = ''; - - this.itemWidth = this.items[0].offsetWidth; - - this.items.forEach((item) => { - maxTitleHeight = Math.max(item.querySelector('.title').offsetHeight, maxTitleHeight); - }); - - this.block.style.setProperty('--min-title-height', maxTitleHeight + 'px'); - this.update(); - } - - onClickItem(i) { - if (!this.isManipulated) { - this.goTo(i); - } - } - - handleArrows () { - this.previous.addEventListener('click', () => { - this.goTo(this.index-1); - }); - this.next.addEventListener('click', () => { - this.goTo(this.index+1); - }); - } - - handlePointers () { - let endEvents = ['pointerup'], - startX, - endX, - threshold = 30, - isPointerDown = false; - - this.block.style.touchAction = 'pan-y'; - - this.block.addEventListener('pointerdown', (event) => { - this.content.classList.add('is-grabbing'); - startX = event.clientX; - isPointerDown = true; - }); - - this.block.addEventListener('pointermove', (event) => { - this.isManipulated = isPointerDown; - endX = event.clientX; - }); - - endEvents.forEach(event => { - this.block.addEventListener(event, (event) => { - isPointerDown = false; - this.onManipulationEnd(startX, endX, threshold); - }); - }); - } - - onManipulationEnd (start, end, threshold) { - if (start > end + threshold) { - this.goTo(this.index+1); - } else if (start < end - threshold) { - this.goTo(this.index-1); - } - - this.content.classList.remove('is-grabbing'); - - // Add delay to avoid conflict with item clicked - setTimeout(() => { - this.isManipulated = false; - }, 100); - } - - goTo (_index) { - this.index = Math.min(Math.max(_index, 0), this.items.length-1); - this.update(); - } - - update () { - this.list.style.marginLeft = `${-this.index * this.itemWidth}px`; - - this.items.forEach((item, index) => { - if (index < this.index) { - item.classList.add('is-passed'); - } else { - item.classList.remove('is-passed'); - } - }); - - if (this.previous && this.next) { - this.previous.disabled = this.index === 0; - this.next.disabled = this.index === this.items.length - 1; - } - } -} - -timelines.forEach((timeline) => { - new BlockTimeline(timeline); -}); diff --git a/assets/js/theme/index.js b/assets/js/theme/index.js index 5dc97bb8ec7e3c3e26fc77abafc75bfff9144365..98f75c1c3f810d4ba5ca0751d677168bf82aa0a1 100644 --- a/assets/js/theme/index.js +++ b/assets/js/theme/index.js @@ -8,5 +8,5 @@ import './design-system/search'; import './design-system/toc'; import './blocks/keyFigures'; import './blocks/organizations'; -import './blocks/timeline'; +import './blocks/draggableBlocks.js'; import './blocks/videos.js'; diff --git a/assets/js/vendors/carousel.js b/assets/js/vendors/carousel.js index 41d1afa93a711b7adc3bb8a7c1f0b52d307d58ea..a983e5fc05614fadd6fd7a6d87df8eadabeb29a7 100644 --- a/assets/js/vendors/carousel.js +++ b/assets/js/vendors/carousel.js @@ -1,17 +1,21 @@ import Splide from '@splidejs/splide'; -Splide.defaults = { - i18n: { - first: 'Aller au premier slide', - last: 'Aller au dernier slide', - next: 'Slide suivant', - pageX: 'Aller à la page %s', - pause: 'Mettre en pause le carousel', - play: 'Démarrer le carousel', - prev: 'Slide précedent', - slideX: 'Aller au slide %s' - } -}; +let siteLang = document.querySelector('html').getAttribute('lang'); + +if (siteLang == "fr") { + Splide.defaults = { + i18n: { + first: 'Aller au premier slide', + last: 'Aller au dernier slide', + next: 'Slide suivant', + pageX: 'Aller à la page %s', + pause: 'Mettre en pause le carousel', + play: 'Démarrer le carousel', + prev: 'Slide précedent', + slideX: 'Aller au slide %s' + } + }; +} class Carousel { constructor (element) { diff --git a/assets/js/vendors/lightbox.js b/assets/js/vendors/lightbox.js index b2cb76170eee2e4539d69146e2d38341a4050aaa..b8c477970840c1b4283c9f217b4e6335c7f5f264 100644 --- a/assets/js/vendors/lightbox.js +++ b/assets/js/vendors/lightbox.js @@ -1,6 +1,39 @@ import gLightbox from 'glightbox'; -gLightbox({ +let siteLang = document.querySelector('html').getAttribute('lang'); + +let lightboxBtn; + +const lightbox = gLightbox({ + selector: '.glightbox', openEffect: 'fade', - closeEffect: 'fade' + closeEffect: 'fade', + onOpen: () => { + lightboxBtn = document.activeElement; + const lightboxContainer = document.querySelector('#glightbox-body'); + lightboxContainer.setAttribute('aria-modal', 'true'); + + if(siteLang == "fr") { + const nextButton = document.querySelector('.gnext'); + const prevButton = document.querySelector('.gprev'); + const closeButton = document.querySelector('.gclose'); + + nextButton.setAttribute('aria-label', 'Suivant'); + prevButton.setAttribute('aria-label', 'Précédent'); + closeButton.setAttribute('aria-label', 'Fermer'); + } + }, + onClose: () => { + if (lightboxBtn) { + lightboxBtn.focus(); + } + } }); + +lightbox.on('slide_changed', () => { + const currentSlide = document.querySelector('.gslide.current'); + if (currentSlide) { + currentSlide.setAttribute("tabindex", "0"); + currentSlide.focus(); + } +}); \ No newline at end of file diff --git a/assets/sass/_theme/_configuration.sass b/assets/sass/_theme/_configuration.sass index 368097c65b032fc484ce363bb616a8dbec487846..781c77db3764d5440f2664fec2c40b4611b323dd 100644 --- a/assets/sass/_theme/_configuration.sass +++ b/assets/sass/_theme/_configuration.sass @@ -410,6 +410,9 @@ $block-pages-card-page-color-hover: var(--color-background) !default // Block posts $block-posts-grid-columns: 3 !default +// Block programs +$block-programs-aspect-ratio: 16/9 !default + // Block timeline $block-timeline-horizontal-background: var(--color-background-alt) !default $block-timeline-horizontal-color: var(--color-text) !default @@ -433,6 +436,7 @@ $block-testimonials-pagination-progress-background: var(--color-accent) !default $block-key_figures-number-font-family: $heading-font-family !default $block-key_figures-unit-font-weight: normal !default $block-key_figures-number-font-weight: bold !default +$block-key_figures-image-max-width: $spacing-6 !default $block-key_figures-font-size: pxToRem(16) !default $block-key_figures-number-font-size: pxToRem(32) !default @@ -488,5 +492,5 @@ $arrow-ease-transition-2: cubic-bezier(0, 0.65, 0.4, 1) !default $icon-burger-margin-right: -12px $icon-close-margin-right: -12px $icon-toc-margin-right: -14px -$icon-arrow-previous-margin-left: -22px // cf. testimonial +$icon-arrow-previous-margin-left: -18px // cf. testimonial $icon-social-margin-right: -14px diff --git a/assets/sass/_theme/_utils.sass b/assets/sass/_theme/_utils.sass index 3ef8b2955fa973e46ef7bc414111eec283c7d010..8fe28937e1de3e2fd1d88dda102a1b1d5322e621 100644 --- a/assets/sass/_theme/_utils.sass +++ b/assets/sass/_theme/_utils.sass @@ -7,5 +7,6 @@ @import utils/normalize @import utils/sidebar @import utils/sizes +@import utils/blocks -@import utils/shame +@import utils/shame \ No newline at end of file diff --git a/assets/sass/_theme/blocks/gallery.sass b/assets/sass/_theme/blocks/gallery.sass index f5fc7b1b00aa9aa4bae34ece7b84f5caf61ae272..f75ddd42a15ed6fae94ec58b6f296d95c1cb0b66 100644 --- a/assets/sass/_theme/blocks/gallery.sass +++ b/assets/sass/_theme/blocks/gallery.sass @@ -2,15 +2,13 @@ figure display: block margin-bottom: 0 + position: relative > a, img, picture display: block > a - transition: filter .3s ease - &:hover - // if low opacity means not selected, selected needs to be darker - filter: brightness(95%) + @include stretched-link img height: auto width: 100% diff --git a/assets/sass/_theme/blocks/key_figures.sass b/assets/sass/_theme/blocks/key_figures.sass index 80b4abcca76d1e6ebc82ea80c5ed963e9be765a2..64126a161eb8adc3aaecd984d939aa656b4a266c 100644 --- a/assets/sass/_theme/blocks/key_figures.sass +++ b/assets/sass/_theme/blocks/key_figures.sass @@ -26,6 +26,10 @@ font-size: $block-key_figures-number-font-size font-weight: $block-key_figures-number-font-weight margin-inline-end: 0.1em + img + display: block + margin-bottom: $spacing-2 + max-width: $block-key_figures-image-max-width @include media-breakpoint-up(desktop) font-size: $block-key_figures-font-size-desktop strong diff --git a/assets/sass/_theme/blocks/posts.sass b/assets/sass/_theme/blocks/posts.sass index 15db653de1ebab9ec64bd53da10c698560779275..5bbc3b2c3beeec4221305b7f43a9ddd7ab037c73 100644 --- a/assets/sass/_theme/blocks/posts.sass +++ b/assets/sass/_theme/blocks/posts.sass @@ -9,6 +9,7 @@ @include grid(1) @include grid($block-posts-grid-columns, desktop) article + @include author-and-time-side-to-side [itemprop=headline] a @include stretched-link @@ -18,7 +19,6 @@ margin-top: $spacing-2 .media margin-top: 0 - @include author-and-time-side-to-side &--grid @include media-breakpoint-down(desktop) @@ -289,6 +289,58 @@ margin-right: auto .post width: columns(4) + &--carousel + @include draggable-block + .container + padding-right: 0 + .carousel + padding-bottom: $spacing-3 + &:hover + cursor: grab + &.is-grabbing + cursor: grabbing + li + list-style: none + .posts + display: flex + gap: unset + .post + margin: 0 calc(var(--grid-gutter) / 2) + .actions-arrows + justify-content: space-between + @include media-breakpoint-down(desktop) + .carousel + gap: half(var(--grid-gutter)) + .post + width: columns(10) + .grab-item:last-of-type + margin-right: half(var(--grid-gutter)) + .actions-arrows + margin-right: var(--grid-gutter) + @include media-breakpoint-up(desktop) + .next + margin-right: pxToRem(-27) // Marge négative pour aligner correctement le picto à la colonne + @include in-page-with-sidebar + .post + width: columns(3) + [itemprop="headline"] + @include h4 + .carousel + .actions-arrows + width: offset(6) + @include in-page-without-sidebar + .block-content + display: flex + gap: var(--grid-gutter) + .top + width: columns(3) + .carousel + width: columns(9) + .post + width: columns(4) + .carousel + .actions-arrows + width: offset(8) // Move this part to blocks/categories when categories block is ready .block-posts diff --git a/assets/sass/_theme/blocks/programs.sass b/assets/sass/_theme/blocks/programs.sass index d5a29aa2ce6828bb2edf1a8f15ebc86edbb47b28..482b7701222ba007293c7819e4d8cfa8e783b7a5 100644 --- a/assets/sass/_theme/blocks/programs.sass +++ b/assets/sass/_theme/blocks/programs.sass @@ -1,19 +1,54 @@ .block-programs - .programs - li - display: block - a - @include h3 - @include arrow-right-hover - display: flex - justify-content: space-between - transition: color 0.55s - padding-right: $spacing-4 - &:hover - color: var(--color-accent) - @include in-page-without-sidebar + &--list .programs li + display: block a - @include h2 \ No newline at end of file + @include h3 + @include arrow-right-hover + display: flex + justify-content: space-between + transition: color 0.55s + padding-right: $spacing-4 + &:hover + color: var(--color-accent) + @include in-page-without-sidebar + .programs li a + @include h2 + + &--grid + .programs-grid + align-items: start + @include grid(1, false, $spacing-5) + @include grid(2, xl) + article + display: flex + flex-direction: column + .program-content + order: 2 + position: relative + &:hover + .more:after + transform: translateX($spacing-1) + [itemprop='name'] + margin-bottom: $spacing-1 + a + @include stretched-link + text-decoration: none + .more + @include icon(arrow, after, true) + @include hover-translate-icon + .media + order: 1 + margin-bottom: $spacing-3 + img + aspect-ratio: $block-programs-aspect-ratio + display: block + object-fit: cover + + + @include in-page-without-sidebar + @include grid(2) + @include grid(3, xl) + diff --git a/assets/sass/_theme/blocks/projects.sass b/assets/sass/_theme/blocks/projects.sass new file mode 100644 index 0000000000000000000000000000000000000000..0b74eec0c4b8352bcdb41bb5518a8ee0aab45a77 --- /dev/null +++ b/assets/sass/_theme/blocks/projects.sass @@ -0,0 +1,3 @@ +.block-projects + .grid + @include grid(2, md) \ No newline at end of file diff --git a/assets/sass/_theme/blocks/timeline.sass b/assets/sass/_theme/blocks/timeline.sass index 1ffa69aefa220b406b18bafc9599823940819702..cb1be7fde5adc3a16af27eeae3d81ab2de5a9804 100644 --- a/assets/sass/_theme/blocks/timeline.sass +++ b/assets/sass/_theme/blocks/timeline.sass @@ -61,54 +61,17 @@ margin-left: columns(3) &--horizontal + @include draggable-block --min-title-height: 0px background: $block-timeline-horizontal-background color: $block-timeline-horizontal-color - overflow: hidden padding-bottom: var(--block-space-y) padding-top: var(--block-space-y) &::before display: none - .timeline - &:hover - cursor: grab - &.is-grabbing - cursor: grabbing - - .timeline-arrows - display: flex - padding-left: calc(var(--grid-gutter) / 2) - > button - @include button-reset - background: none - border: none - color: $block-timeline-horizontal-color - cursor: pointer - &:first-child - @include icon-block(arrow-previous, before) - margin-left: $icon-arrow-previous-margin-left - &:last-child - @include icon-block(arrow-next, before) - &:disabled - cursor: default - opacity: 0.3 - .timeline-events - margin-left: calc(var(--grid-gutter-negative) / 2) - margin-right: calc(var(--grid-gutter-negative) / 2) - ol - display: flex - flex-flow: row nowrap - list-style: none - padding-left: 0 - margin-top: $spacing-2 - transition: margin 0.4s ease-in-out - width: 100% .timeline-event - flex: none padding: 0 calc(var(--grid-gutter) / 2) - scroll-snap-align: start - transition: 0.3s opacity - width: 50% + width: columns(4) .title display: block min-height: var(--min-title-height) @@ -133,8 +96,6 @@ position: relative top: -4px width: 9px - &.is-passed - opacity: 0.15 &:last-child .line background: transparent @@ -147,11 +108,12 @@ @include media-breakpoint-down(desktop) .timeline-events position: relative - .timeline-arrows + .actions-arrows left: 0 position: absolute top: calc(#{$spacing-2} + var(--min-title-height)) .timeline-event + margin-right: 0 padding-right: 0 width: 75% .line diff --git a/assets/sass/_theme/design-system/hero.sass b/assets/sass/_theme/design-system/hero.sass index 2eed2a63d77a44f78447d12218f3d1bffe1c7e7c..2231ea2659bb27611337e57ef9c80877cc533726 100644 --- a/assets/sass/_theme/design-system/hero.sass +++ b/assets/sass/_theme/design-system/hero.sass @@ -41,6 +41,11 @@ margin-bottom: 0 & + .document-content margin-top: $spacing-5 + &--with-image + figure + position: relative + > a + @include stretched-link @include media-breakpoint-down(desktop) &--with-image padding-bottom: 0 diff --git a/assets/sass/_theme/hugo-osuny.sass b/assets/sass/_theme/hugo-osuny.sass index aaeab07820e035608b91228a527223bcad6c9a30..b2956dd57043f41c5b23592089a26ab786aa0a2f 100644 --- a/assets/sass/_theme/hugo-osuny.sass +++ b/assets/sass/_theme/hugo-osuny.sass @@ -56,6 +56,7 @@ @import blocks/pages @import blocks/persons @import blocks/posts +@import blocks/projects @import blocks/programs @import blocks/sitemap @import blocks/sound @@ -75,6 +76,7 @@ @import sections/papers @import sections/persons @import sections/posts +@import sections/projects @import sections/programs @import sections/publications @import sections/researchers diff --git a/assets/sass/_theme/sections/diplomas.sass b/assets/sass/_theme/sections/diplomas.sass index f41bb60f1440bd544ad4c70d449e786a472ae3ac..66e730629c674c538caf928d8deb13083ef760cc 100644 --- a/assets/sass/_theme/sections/diplomas.sass +++ b/assets/sass/_theme/sections/diplomas.sass @@ -118,8 +118,6 @@ ul.diplomas display: flex flex-wrap: wrap .dropdown-share - --btn-background: #{$hero-background-color} - --btn-hover-background: #{$color-background} button @extend .button @include button-icon(social-inline) diff --git a/assets/sass/_theme/sections/posts.sass b/assets/sass/_theme/sections/posts.sass index 6fb689aa5447238b9bc37e90969a5a2ef4aecaa7..5c319a79ad3653fca4f326a81ee818a298629a33 100644 --- a/assets/sass/_theme/sections/posts.sass +++ b/assets/sass/_theme/sections/posts.sass @@ -4,19 +4,6 @@ color: $post-time-color display: inline-block vertical-align: middle - .post-categories - @include meta - margin-top: $spacing-2 - margin-bottom: $spacing-2 - position: relative - display: flex - flex-wrap: wrap - gap: 0 $spacing-2 - z-index: 2 - a - @include link(var(--color-accent)) - li - margin: 0 .post-author @include meta color: var(--color-text-alt) @@ -91,57 +78,8 @@ .post-sidebar @include sidebar -.post-categories - @include list-reset - margin: 0 - li - display: inline-block - vertical-align: middle - margin-left: $spacing-1 - &:last-child - &::after - content: none - .post-infos - margin-bottom: 0 - @include meta - @include list-reset - font-size: $table-body-size - @include media-breakpoint-up(desktop) - font-size: $table-body-size-desktop - > li - @include meta - display: flex - gap: $spacing-3 - justify-content: space-between - padding-top: $spacing-2 - padding-bottom: $spacing-2 - border-color: var(--color-border) - &:not(:first-child) - align-items: center - border-top: 1px solid var(--color-border) - > span - @include meta - color: var(--color-text-alt) - padding-left: 0 - white-space: nowrap - vertical-align: top - > ul - text-align: right - flex: 1 - &.social-share - align-items: center - a - @include link(var(--color-accent)) - text-align: right - .share - display: block - li - display: inline-block - a - color: inherit - li:last-child - margin-right: -$spacing-2 + @include section__page-infos .related margin-top: $spacing-3 diff --git a/assets/sass/_theme/sections/programs.sass b/assets/sass/_theme/sections/programs.sass index 8257c07f1ce954d12710c3a9df8340268061a643..9773684a4be1ed2f6817cb12324665cb3f7d7948 100644 --- a/assets/sass/_theme/sections/programs.sass +++ b/assets/sass/_theme/sections/programs.sass @@ -21,6 +21,7 @@ ol.programs justify-content: end .container position: relative + &:not(.full-width) .document-content .lead diff --git a/assets/sass/_theme/sections/projects.sass b/assets/sass/_theme/sections/projects.sass new file mode 100644 index 0000000000000000000000000000000000000000..7f2edc7f544ef36018216e371f439f590907cb97 --- /dev/null +++ b/assets/sass/_theme/sections/projects.sass @@ -0,0 +1,39 @@ +.project + @include article(auto) + +.projects__section, +.projects_categories__term + .projects + @include grid(2, md) + +.projects__page + .hero + .content + align-items: stretch + .hero-text + display: flex + flex-direction: column + gap: $spacing-3 + @include media-breakpoint-up(sm) + .hero + .project-infos + width: columns(8) + @include media-breakpoint-up(md) + .hero + .project-infos + width: columns(6) + @include media-breakpoint-up(desktop) + .hero + .content + align-items: stretch + .hero-text + justify-content: space-between + gap: $spacing-5 + width: columns(6) + .project-infos + width: columns(4) + figure + width: columns(6) + +.project-infos + @include section__page-infos \ No newline at end of file diff --git a/assets/sass/_theme/sections/publications.sass b/assets/sass/_theme/sections/publications.sass index e98afecaa17a887786e75eaa8862cbdf2b957346..ac9f2ba021257961e81dc46f1248047b602af979 100644 --- a/assets/sass/_theme/sections/publications.sass +++ b/assets/sass/_theme/sections/publications.sass @@ -17,6 +17,9 @@ padding-bottom: $spacing-2 padding-top: $spacing-2 position: relative + @include icon-block(arrow-right, before) + position: absolute + right: 0px a text-decoration: none .publication-title @@ -24,15 +27,17 @@ @include stretched-link(after) &:hover color: var(--color-accent) - @include icon-block(arrow-right, before) - position: absolute - right: 0px .publication-meta @include small color: var(--color-text-alt) margin-top: $spacing-1 a color: var(--color-text-alt) + @include media-breakpoint-down(desktop) + .publication-meta + padding-right: $spacing-4 + &::before + bottom: 0 .publications margin-top: $spacing-5 diff --git a/assets/sass/_theme/utils/blocks.sass b/assets/sass/_theme/utils/blocks.sass new file mode 100644 index 0000000000000000000000000000000000000000..7343e4ae3510aee699d508250f1e900ebd75c694 --- /dev/null +++ b/assets/sass/_theme/utils/blocks.sass @@ -0,0 +1,43 @@ +@mixin draggable-block + overflow: hidden + .draggable-container + &:hover + cursor: grab + &.is-grabbing + cursor: grabbing + .draggable-content + margin-left: calc(var(--grid-gutter-negative) / 2) + margin-right: calc(var(--grid-gutter-negative) / 2) + > ul, + > ol + display: flex + flex-flow: row nowrap + list-style: none + padding-left: 0 + transition: margin 0.4s ease-in-out + width: 100% + .draggable-item + flex: none + scroll-snap-align: start + transition: 0.3s opacity + &.is-passed + opacity: 0.15 + pointer-events: none + .actions-arrows + display: flex + margin-left: calc(var(--grid-gutter) / 2) + > button + @include button-reset + background: none + border: none + color: $block-timeline-horizontal-color + cursor: pointer + padding: 0 + &:first-child + @include icon-block(arrow-previous, before) + margin-left: $icon-arrow-previous-margin-left + &:last-child + @include icon-block(arrow-next, before) + &:disabled + cursor: default + opacity: 0.3 \ No newline at end of file diff --git a/assets/sass/_theme/utils/shame.sass b/assets/sass/_theme/utils/shame.sass index e6c0cdb5ca93291793dceb41da16d040a3d199ad..1be170d21d897d77612726d2666090c4d977098b 100644 --- a/assets/sass/_theme/utils/shame.sass +++ b/assets/sass/_theme/utils/shame.sass @@ -17,8 +17,8 @@ .post-author p::before content: ' • ' -// TODO: transformer en class %article -@mixin article +// Utilisé pour .post, .project, .page, .person, .program, .volume +@mixin article($aspect-ratio: $article-media-aspect-ratio) position: relative display: flex flex-direction: column @@ -30,16 +30,30 @@ img display: block object-fit: cover - @if $article-media-aspect-ratio - aspect-ratio: $article-media-aspect-ratio - h2, h3, [itemprop=headline] + @if $aspect-ratio + aspect-ratio: $aspect-ratio + h2, h3, [itemprop=headline], [itemprop=name] @include h3 a - display: block @include stretched-link + display: block text-decoration: none p + time margin-top: $spacing-2 + .post-categories, .project-categories + @include list-reset + @include meta + margin-top: $spacing-2 + margin-bottom: $spacing-2 + position: relative + display: flex + flex-wrap: wrap + gap: 0 $spacing-2 + z-index: 2 + a + @include link(var(--color-accent)) + li + margin: 0 time @include meta color: var(--color-text-alt) diff --git a/assets/sass/_theme/utils/sidebar.sass b/assets/sass/_theme/utils/sidebar.sass index cfed229ed0239a5a395a6e3bf94a50a92fdcb34c..f82412c80a332579506a57dbbbb95ba1930a1ac4 100644 --- a/assets/sass/_theme/utils/sidebar.sass +++ b/assets/sass/_theme/utils/sidebar.sass @@ -39,7 +39,6 @@ html:not(.is-scrolling-down) & top: calc(var(--header-height) + #{$offset-y}) - @mixin sidebar($side: start) @include media-breakpoint-down(desktop) padding: 0 var(--grid-gutter) @@ -63,3 +62,55 @@ padding-top: $spacing-3 position: static margin-left: 0 + +// Utilisé dans .post-infos, et project-infos +@mixin section__page-infos + @include meta + @include list-reset + font-size: $table-body-size + margin-bottom: 0 + @include media-breakpoint-up(desktop) + font-size: $table-body-size-desktop + > li + @include meta + display: flex + gap: $spacing-3 + justify-content: space-between + padding-top: $spacing-2 + padding-bottom: $spacing-2 + border-color: var(--color-border) + &:not(:first-child) + align-items: center + border-top: 1px solid var(--color-border) + > span + @include meta + color: var(--color-text-alt) + padding-left: 0 + white-space: nowrap + vertical-align: top + > ul + text-align: right + flex: 1 + &.social-share + align-items: center + a + @include link(var(--color-accent)) + text-align: right + .terms + @include list-reset + margin: 0 + li + display: inline-block + vertical-align: middle + margin-left: $spacing-1 + &:last-child + &::after + content: none + .share + display: block + li + display: inline-block + a + color: inherit + li:last-child + margin-right: -$spacing-2 \ No newline at end of file diff --git a/bin/osuny.js b/bin/osuny.js index a5ef2a2811fe797792de9badabe186b9308a312a..41860abfd2bb350e3730b631362abc7985bf6b4d 100644 --- a/bin/osuny.js +++ b/bin/osuny.js @@ -20,22 +20,27 @@ console.log(` const command = process.argv[2]; -let pagefindExclude = ` - .administrators__term, - .authors__term, - .categories__taxonomy, .categories__term, - .posts_categories__taxonomy, .posts_categories__term, - .events_categories__taxonomy, .events_categories__term, - .diplomas__taxonomy, .block-diplomas, - .events__section, .block-agenda, - .organizations__section, .block-organizations, - .block-pages, - .persons__section, .block-persons, - .posts__section, .block-posts, .post-sidebar, - .block-programs, - .researchers__term, - .teachers__term - `; +let pagefindExclude = ''; +// Categories: No list of categories +pagefindExclude += '.categories__taxonomy, .categories__term, '; +pagefindExclude += '.posts_categories__taxonomy, .posts_categories__term, '; +pagefindExclude += '.events_categories__taxonomy, .events_categories__term, '; +// Diplomas: No list of diplomas or block diplomas +pagefindExclude += '.diplomas__taxonomy, .block-diplomas, '; +// Agenda events: No list of events or block events +pagefindExclude += '.events__section, .block-agenda, '; +// Organizations: No list of organizations or block organizations +pagefindExclude += '.organizations__section, .block-organizations, '; +// Pages: No block pages (there's no difference between list and page) +pagefindExclude += '.block-pages, '; +// Persons: no list or block +pagefindExclude += '.persons__section, .block-persons, '; +// No list of people's facets +pagefindExclude += '.administrators__term, .authors__term, .researchers__term, .teachers__term,'; +// Posts: no list, block posts, or post sidebar +pagefindExclude += '.posts__section, .block-posts, .post-sidebar, '; +// Programs: no block +pagefindExclude += '.block-programs'; function execute(string) { console.log("OSUNY runs " + string); diff --git a/config.yaml b/config.yaml index 7540ffe146e3f88f4c0aaa8d961ddc76f0cd49be..38b0724b3c95306793197b12e432efd4ef850d36 100644 --- a/config.yaml +++ b/config.yaml @@ -3,14 +3,12 @@ params: active: false productionUrl: "" keycdn: https://osuny-1b4da.kxcdn.com - cookie_banner: - enable: false - blank: true - page: https://gdpr.eu/cookies/ plausible: false seo: title: separator: "|" + + # DESIGN SYSTEM logo: header: "/assets/images/logo.svg" footer: "/assets/images/logo.svg" @@ -37,6 +35,8 @@ params: home: toc: disabled: true + + # SECTIONS events: default_image: false date_format: ":date_long" @@ -55,12 +55,11 @@ params: default_image: false index: truncate_description: 200 # Set to 0 to disable truncate + layout: grid # grid | list papers: default_image: false sidebar: direction: start - volumes: - default_image: false persons: index: layout: grid # grid | list @@ -82,9 +81,29 @@ params: email: false telegram: false whatsapp: false + projects: + default_image: false + date_format: "2006" + index: + show_categories: true + show_description: true + show_year: false + truncate_description: 200 # Set to 0 to disable truncate + layout: list # grid | list + share_links: + facebook: true + twitter: true + linkedin: true + email: false + telegram: false + whatsapp: false programs: related_posts: quantity: 4 + volumes: + default_image: false + + # BLOCKS blocks: gallery: splide: @@ -126,6 +145,10 @@ params: mobile: 350 tablet: 400 desktop: 750 + key_figures: + mobile: 100 + tablet: 100 + desktop: 150 image: mobile: 480x850 tablet: 768x1360 @@ -168,6 +191,10 @@ params: mobile: 170 tablet: 350 desktop: 415 + programs: + mobile: 400 + tablet: 800 + desktop: 600 sections: categories: hero: @@ -258,11 +285,19 @@ params: mobile: 350 tablet: 450 desktop: 600 - publications: + projects: hero: mobile: 400 tablet: 800 desktop: 750 + hero_single: + mobile: 400 + tablet: 800 + desktop: 750 + item: + mobile: 350 + tablet: 450 + desktop: 600 programs: hero: mobile: 400 @@ -272,6 +307,11 @@ params: mobile: 351x168 tablet: 456x219 desktop: 856x410 + publications: + hero: + mobile: 400 + tablet: 800 + desktop: 750 volumes: hero: mobile: 400 diff --git a/i18n/en.yml b/i18n/en.yml index 6fd7068d1bc737b29117fa46a7e05f8ef87a8fc7..16a2bf4d9eaf02f9aa7310fa3f04e1c3fa570fb9 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -4,7 +4,9 @@ blocks: categories: title: Catégories items: - count: "{{ .Count }} articles" + count: + one: "1 article" + other: "{{ .Count }} articles" chapter: title: Chapter contact: @@ -52,6 +54,7 @@ blocks: play: Play video categories: no_post: No post in this category + no_project: No project in this category see_more: one: See the post other: See the {{ .Count }} posts @@ -141,12 +144,6 @@ commons: bytes: bytes extensions: PDF: Adobe Portable Document Format -cookie_banner: - accept: Accept - more: Read more - refuse: Refuse - text: This site uses cookies to improve the browsing experience and provide additional functionality. - title: Cookie banner diplomas: type: Type de diplôme events: @@ -226,7 +223,7 @@ posts: next: Next article next_aria: Next article “{{ .Title }}†previous: Previous article - previous_aria: revious article “{{ .Title }}†+ previous_aria: Previous article “{{ .Title }}†reading_time: Reading time see_all: See all posts see_all_in_program: See all program's news @@ -234,6 +231,24 @@ posts: share: Please, share share_aria: Share on “{{ .Title }}†- extern link title: News +projects: + author: Author + category: + one: Category + other: Categories + informations: Informations + next: Next project + next_aria: Next project “{{ .Title }}†+ previous: Previous project + previous_aria: Previous project “{{ .Title }}†+ reading_time: Reading time + see_all: See all posts + see_all_in_program: See all program's projects + see_all_in_category: See all projects in “{{ .Title }}†+ share: Please, share + share_aria: Share on “{{ .Title }}†- extern link + title: Projects + year: Year programs: accessibility: Accessibility administrative_information: Administrative information diff --git a/i18n/fr.yml b/i18n/fr.yml index 69e3d66e10fcb5d6f0fec34a9bc98eac0fe12466..086bae77aa0f0e8353c210a5209bc27a80887f84 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -54,6 +54,7 @@ blocks: play: Lancer la vidéo categories: no_post: Aucun article dans cette catégorie + no_project: Aucun projet dans cette catégorie see_more: one: Voir l'article other: Voir les {{ .Count }} articles @@ -143,12 +144,6 @@ commons: bytes: octets extentions: PDF: Adobe Portable Document Format -cookie_banner: - accept: Accepter - more: En savoir plus - refuse: Refuser - text: Ce site utilise des cookies pour améliorer l’expérience de navigation et fournir des fonctionnalités supplémentaires. - title: Bandeau cookie diplomas: type: Type de diplôme events: @@ -237,6 +232,24 @@ posts: share: Partager sur share_aria: Partager sur “{{ .Title }}†- lien externe title: Actualités +projects: + author: Auteur·rice + category: + one: Catégorie + other: Catégories + informations: Informations + next: Projet suivant + next_aria: Projet suivant “{{ .Title }}†+ previous: Projet précédent + previous_aria: Projet précédent “{{ .Title }}†+ reading_time: Temps de lecture + see_all: Voir toutes les projets + see_all_in_program: Voir toutes les projets de la formation + see_all_in_category: Voir toutes les projets “{{ .Title }}†+ share: Partager sur + share_aria: Partager sur “{{ .Title }}†- lien externe + title: Projets + year: Année programs: accessibility: Accessibilité administrative_information: Informations administratives diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index be5a617e335b9542e19d090ef1a58d4e4dee369c..2c3c7c85349a60d1da23c04d28a1c390dd0ab8e1 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -27,7 +27,6 @@ {{- partial "hooks/before-main-end" . -}} </main> {{- partial "footer/footer.html" . -}} - {{- partial "footer/cookie-banner.html" . -}} {{- partial "footer/plausible.html" . -}} {{- partial "footer/js.html" . -}} {{- partial "footer/script.html" . -}} diff --git a/layouts/events/single.html b/layouts/events/single.html index f1c4debe5ba46368453b5b81f8d8c7e0c242af38..ce11f636202c46779b48340edc07546781baa3e5 100644 --- a/layouts/events/single.html +++ b/layouts/events/single.html @@ -4,8 +4,7 @@ <div class="document-content" itemscope itemtype="https://schema.org/Event"> <meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}"> <meta itemprop="url" content="{{ .Permalink }}"> - {{ with .Params.summary }}<meta itemprop="abstract" content="{{ . | safeHTML }}">{{ end }} - {{ with .Summary }}<meta itemprop="description" content="{{ . | safeHTML }}">{{ end }} + {{ with .Params.summary }}<meta itemprop="description" content="{{ . | safeHTML }}">{{ end }} {{ partial "events/sidebar.html" . }} diff --git a/layouts/partials/blocks/templates/gallery/carousel.html b/layouts/partials/blocks/templates/gallery/carousel.html index b1b5a396b11049866370b520d64b9a00ce9061f5..0c472729dce6f6e60cab08147a476887d3266fba 100644 --- a/layouts/partials/blocks/templates/gallery/carousel.html +++ b/layouts/partials/blocks/templates/gallery/carousel.html @@ -4,7 +4,7 @@ {{ end }} {{- if $is_carousel }} -<div class="splide" role="group" data-splide="{{ site.Params.blocks.gallery.splide | encoding.Jsonify }}"> +<div class="splide" data-splide="{{ site.Params.blocks.gallery.splide | encoding.Jsonify }}"> <div class="splide__track"> <div class="splide__list"> {{ end -}} @@ -14,21 +14,25 @@ {{- $image := partial "GetMedia" .file -}} {{- if $image -}} <figure {{ if $is_carousel }} class="splide__slide"{{ end }}> + {{ partial "commons/image.html" + (dict + "image" .id + "alt" .alt + "sizes" site.Params.image_sizes.blocks.gallery.carousel + )}} {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + {{ $lightbox_text := false }} + {{ if and .text .credit }} + {{ $lightbox_text = delimit (slice .text .credit) " / " }} + {{ else }} + {{ $lightbox_text = or .text .credit }} + {{ end }} <a class="glightbox" role="button" - data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" + data-glightbox="type: image;{{ with $lightbox_text }}description: {{ partial "PrepareHTML" . }}{{ end }}" href="{{ partial "GetLightboxUrl" (dict "id" .id) }}" title="{{- i18n "commons.lightbox.link.title" -}}" aria-label="{{- i18n "commons.lightbox.link.title" -}}"> - {{ end }} - {{ partial "commons/image.html" - (dict - "image" .id - "alt" .alt - "sizes" site.Params.image_sizes.blocks.gallery.carousel - )}} - {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} </a> {{ end }} {{ if or .text .credit }} diff --git a/layouts/partials/blocks/templates/gallery/grid.html b/layouts/partials/blocks/templates/gallery/grid.html index dd9b600333b267c5d91c6516bfe1f359b9aa1c27..dc777bd3d947eeaa34ccdce1c58bca0fbe77e800 100644 --- a/layouts/partials/blocks/templates/gallery/grid.html +++ b/layouts/partials/blocks/templates/gallery/grid.html @@ -4,12 +4,18 @@ {{- $has_text = true -}} {{ end -}} {{ end -}} -<div class="gallery{{- if $has_text }} gallery--with-text {{ end -}}" role="group"> +<div class="gallery{{- if $has_text }} gallery--with-text {{ end -}}"> {{ range .images }} {{ if .id }} {{- $image := partial "GetMedia" .id -}} {{- if $image -}} <figure> + {{ partial "commons/image.html" + (dict + "image" .file + "alt" .alt + "sizes" site.Params.image_sizes.blocks.gallery.grid + )}} {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} {{ $lightbox_text := false }} {{ if and .text .credit }} @@ -23,14 +29,6 @@ href="{{ partial "GetLightboxUrl" (dict "id" .id) }}" title="{{- i18n "commons.lightbox.link.title" -}}" aria-label="{{- i18n "commons.lightbox.link.title" -}}"> - {{ end }} - {{ partial "commons/image.html" - (dict - "image" .file - "alt" .alt - "sizes" site.Params.image_sizes.blocks.gallery.grid - )}} - {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} </a> {{ end }} {{ with .text }} diff --git a/layouts/partials/blocks/templates/key_figures.html b/layouts/partials/blocks/templates/key_figures.html index 2451c75b2cc4a6077d1f24b728eed6baa95957d9..33470c53bff1bb36e6cd64f1a2d0543851f75fb6 100644 --- a/layouts/partials/blocks/templates/key_figures.html +++ b/layouts/partials/blocks/templates/key_figures.html @@ -21,7 +21,16 @@ {{- range .figures }} <li> <dl> - <dt><strong>{{ .number }}</strong>{{ partial "PrepareHTML" .unit }}</dt> + <dt> + {{ with .image }} + {{ partial "commons/image.html" + (dict + "image" . + "sizes" site.Params.image_sizes.blocks.key_figures + )}} + {{ end }} + <strong>{{ .number }}</strong>{{ partial "PrepareHTML" .unit }} + </dt> <dd>{{ partial "PrepareHTML" .description }}</dd> </dl> </li> diff --git a/layouts/partials/blocks/templates/pages/list.html b/layouts/partials/blocks/templates/pages/list.html index 0314906c6715a009eeeb5ec398ccc1e117bec5c7..78de5201cf12bb1fd055270cbbb8cd539b678f01 100644 --- a/layouts/partials/blocks/templates/pages/list.html +++ b/layouts/partials/blocks/templates/pages/list.html @@ -7,7 +7,15 @@ )}} <ul class="list {{ if and (not $show_descriptions) (not $show_images) }} title-only {{ end }}"> {{ range .pages }} - {{ $page := site.GetPage .file }} + {{- $file := false -}} + {{/* Check if . is a map or page url, necessary when pages/list is called outside block context */}} + {{ if reflect.IsMap . }} + {{ $file = .file }} + {{ else }} + {{ $file = . }} + {{ end }} + + {{ $page := site.GetPage $file }} {{ with $page }} <li> {{ if or $show_descriptions $show_images }} diff --git a/layouts/partials/blocks/templates/posts/carousel.html b/layouts/partials/blocks/templates/posts/carousel.html new file mode 100644 index 0000000000000000000000000000000000000000..df63993734923de3d7540d0fe99b159564eb0ca0 --- /dev/null +++ b/layouts/partials/blocks/templates/posts/carousel.html @@ -0,0 +1,24 @@ +{{ $heading_level := .heading_level | default 3 }} +{{ $heading := printf "h%d" $heading_level }} + +<div class="carousel draggable-container"> + <div class="carousel-posts draggable-content"> + <ul class="posts"> + {{ range $post := .posts -}} + {{ with site.GetPage (printf "/posts/%s" $post) }} + <li class="draggable-item"> + {{ partial "posts/post.html" (dict + "post" . + "heading" $heading) }} + </li> + {{ end }} + {{ end }} + </ul> + {{ if (gt (len .posts) 0) }} + <div class="actions-arrows"> + <button class="previous" disabled title="{{ i18n "blocks.timeline.previous"}}"></button> + <button class="next" title="{{ i18n "blocks.timeline.next"}}"></button> + </div> + {{ end }} + </div> +</div> diff --git a/layouts/partials/blocks/templates/programs.html b/layouts/partials/blocks/templates/programs.html index 7170738aedbe15daf0a14c1e71a1d7db52748f09..f534588412f9878c007db95c1f86e972a1713d02 100644 --- a/layouts/partials/blocks/templates/programs.html +++ b/layouts/partials/blocks/templates/programs.html @@ -1,5 +1,10 @@ {{- $block := .block -}} {{- $block_class := partial "GetBlockClass" .block -}} +{{ $heading := .heading | default "h3" }} +{{ $heading_tag := (dict + "open" ((printf "<%s itemprop='name'>" $heading) | safeHTML) + "close" ((printf "</%s>" $heading) | safeHTML) + ) }} {{- with .block.data -}} <div class="{{ $block_class }}"> @@ -10,18 +15,57 @@ "heading_level" $block.ranks.self )}} - <ol class="programs"> - {{- range .programs -}} - <li> + {{- if eq $block.data.layout "grid" -}} + + <div class="programs-grid"> + {{- range .programs -}} {{ $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 -}} - </a> - </li> - {{ end }} - </ol> + {{ $title := $program.Title | safeHTML }} + <article itemscope itemtype="https://schema.org/EducationalOccupationalProgram"> + <div class="program-content"> + {{ $heading_tag.open }} + <a href="{{ $program.Permalink }}" itemtype="url" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}"> + {{- $title -}} + </a> + {{ $heading_tag.close }} + + {{ with $program.Params.summary | safeHTML}} + <p itemprop="abstract">{{ . }}</p> + {{ end }} + + <p class="more meta" aria-hidden="true">{{- i18n "commons.more" -}}</p> + </div> + + {{- if $program.Params.image -}} + <div class="media"> + {{- partial "commons/image.html" + (dict + "image" $program.Params.image + "sizes" site.Params.image_sizes.blocks.programs + ) -}} + </div> + {{- end -}} + + </article> + {{ end }} + </div> + + {{- else -}} + + <ol class="programs"> + {{- range .programs -}} + <li> + {{ $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 -}} + </a> + </li> + {{ end }} + </ol> + + {{- end -}} </div> </div> </div> -{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/layouts/partials/blocks/templates/projects.html b/layouts/partials/blocks/templates/projects.html new file mode 100644 index 0000000000000000000000000000000000000000..126f09b24cd66b91c59e46592744c996b09f954e --- /dev/null +++ b/layouts/partials/blocks/templates/projects.html @@ -0,0 +1,22 @@ +{{- $block := .block -}} +{{- $block_title := .block.title -}} +{{- $block_class := partial "GetBlockClass" .block -}} +{{- $layout := "grid" -}} + +{{- with .block.data -}} + <div class="{{ $block_class }}"> + <div class="container"> + <div class="block-content"> + {{ partial "blocks/top.html" (dict + "title" $block_title + "heading_level" $block.ranks.self + ) }} + + {{- partial (printf "blocks/templates/projects/%s.html" $layout) (dict + "projects" .projects + "heading_level" $block.ranks.children + ) }} + </div> + </div> + </div> +{{- end -}} diff --git a/layouts/partials/blocks/templates/projects/grid.html b/layouts/partials/blocks/templates/projects/grid.html new file mode 100644 index 0000000000000000000000000000000000000000..23ccf769a376c88b7d98e41a92aed02d1e75887f --- /dev/null +++ b/layouts/partials/blocks/templates/projects/grid.html @@ -0,0 +1,12 @@ +{{ $heading_level := .heading_level | default 3 }} +{{ $heading := printf "h%d" $heading_level }} +<div class="grid"> + {{ range $project := .projects -}} + {{ with site.GetPage .file }} + {{ partial "projects/project.html" (dict + "project" . + "heading" $heading + ) }} + {{ end }} + {{ end }} +</div> diff --git a/layouts/partials/blocks/templates/projects/list.html b/layouts/partials/blocks/templates/projects/list.html new file mode 100644 index 0000000000000000000000000000000000000000..70667caeaa211375bdcdfc771353dbe57f2bbaf9 --- /dev/null +++ b/layouts/partials/blocks/templates/projects/list.html @@ -0,0 +1,12 @@ +{{ $heading_level := .heading_level | default 3 }} +{{ $heading := printf "h%d" $heading_level }} +<div class="list"> + {{ range $project := .projects -}} + {{ with site.GetPage .file }} + {{ partial "projects/project.html" (dict + "project" . + "heading" $heading + ) }} + {{ end }} + {{ end }} +</div> diff --git a/layouts/partials/blocks/templates/timeline/horizontal.html b/layouts/partials/blocks/templates/timeline/horizontal.html index d029f0918ec243f4c7170b778dfb1699ddee3e72..f01f6a60a07b1f03aa4858cce20e5d0dd9165299 100644 --- a/layouts/partials/blocks/templates/timeline/horizontal.html +++ b/layouts/partials/blocks/templates/timeline/horizontal.html @@ -4,13 +4,12 @@ "attributes" "class='title'" ) -}} -<div class="timeline"> +<div class="timeline draggable-container"> {{ with .block.data }} - <div class="timeline-events"> + <div class="timeline-events draggable-content"> <ol> {{ range .events }} - <li class="timeline-event"> - + <li class="timeline-event draggable-item"> {{ $heading_tag.open -}} {{ .title | safeHTML }} {{ $heading_tag.close -}} @@ -20,7 +19,7 @@ {{ end }} </ol> {{ if (gt (len .events) 0) }} - <div class="timeline-arrows"> + <div class="actions-arrows"> <button class="previous" disabled title="{{ i18n "blocks.timeline.previous"}}"></button> <button class="next" title="{{ i18n "blocks.timeline.next"}}"></button> </div> diff --git a/layouts/partials/footer/cookie-banner.html b/layouts/partials/footer/cookie-banner.html deleted file mode 100644 index 9e70b81c0464933655c3db54bd58442f45108e9e..0000000000000000000000000000000000000000 --- a/layouts/partials/footer/cookie-banner.html +++ /dev/null @@ -1,14 +0,0 @@ -{{ if site.Params.cookie_banner.enable }} - <div class="gdpr-cookie-consent js-gdpr-cookie-consent" tabindex="-1" role="dialog" aria-label="{{ i18n "cookie_banner.label" }}"> - <div> - <p> - {{ i18n "cookie_banner.text" }} - <a href="{{ site.Params.cookie_banner.page | default "https://gdpr.eu/cookies/" }}"{{ if site.Params.cookie_banner.blank }} target="_blank" ref="noopener"{{ end }}>{{ i18n "cookie_banner.more" }}</a> - </p> - </div> - <div role="group"> - <button type="button" class="js-gdpr-cookie-consent-btn-ok">{{ i18n "cookie_banner.accept" }}</button> - <button type="button" class="js-gdpr-cookie-consent-btn-ko">{{ i18n "cookie_banner.refuse" }}</button> - </div> - </div> -{{ end }} diff --git a/layouts/partials/header/hero.html b/layouts/partials/header/hero.html index cbd33b992555051c4119483ceb375fd5c2349b10..6502a11031969532c00893dc8e088afc69943aa2 100644 --- a/layouts/partials/header/hero.html +++ b/layouts/partials/header/hero.html @@ -43,34 +43,36 @@ <a href="{{ .target }}" class="btn">{{ .label }}</a> {{ end }} {{ end }} + + {{ if .hero_text_complement }} + {{ partial .hero_text_complement .context }} + {{ end }} </div> {{ if .image }} <figure> + {{ partial "commons/image.html" + (dict + "image" .image + "sizes" ( .sizes | default site.Params.image_sizes.design_system.hero ) + "lazy" false + ) }} {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} <a class="glightbox" role="button" - data-glightbox="type: image;{{ if .image.credit }}description: {{ partial "PrepareHTML" .image.credit }}{{ end }}" + data-glightbox="type: image;{{ with .image.credit }}description: {{ partial "PrepareHTML" . }}{{ end }}" href="{{ partial "GetLightboxUrl" .image }}" - title="{{ i18n "commons.lightbox.link.title" }}" - aria-label="{{ i18n "commons.lightbox.link.title" }}"> - {{ end }} - {{ partial "commons/image.html" - (dict - "image" .image - "sizes" ( .sizes | default site.Params.image_sizes.design_system.hero ) - "lazy" false - ) }} - {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + title="{{- i18n "commons.lightbox.link.title" -}}" + aria-label="{{- i18n "commons.lightbox.link.title" -}}"> </a> {{ end }} - {{ if partial "GetTextFromHTML" .image.credit }} - <figcaption tabindex="0"> - <div class="credit-content"> - {{ partial "PrepareHTML" .image.credit }} - </div> - </figcaption> - {{ end }} + {{ with partial "GetTextFromHTML" .image.credit }} + <figcaption tabindex="0"> + <div class="credit-content"> + {{ partial "PrepareHTML" . }} + </div> + </figcaption> + {{ end }} </figure> {{ end }} </div> diff --git a/layouts/partials/pages/children.html b/layouts/partials/pages/children.html index fb6dd823c79574a7bf0327742e3b60f5d548817b..84c53adfe3a2b85add42b2b4312e7c950478443e 100644 --- a/layouts/partials/pages/children.html +++ b/layouts/partials/pages/children.html @@ -2,13 +2,14 @@ {{ if .Params.bodyclass }} {{- $page_class = printf "block-page-%s" .Params.bodyclass }} {{ end }} +{{ $show_images := eq site.Params.pages.index.layout "grid" }} -<div class="block block-pages block-pages--grid {{ $page_class }}"> +<div class="block block-pages block-pages--children block-pages--{{ site.Params.pages.index.layout }} {{ $page_class }}"> <div class="container"> <div class="block-content"> - {{- partial "blocks/templates/pages/grid.html" (dict + {{- partial (printf "blocks/templates/pages/%s.html" site.Params.pages.index.layout) (dict "pages" .Params.children - "show_images" true + "show_images" $show_images "heading_level" 2 "show_descriptions" true ) }} diff --git a/layouts/partials/posts/post-infos.html b/layouts/partials/posts/post-infos.html index 47b8b35b98b5c55acfc3ebe15977dfb9ff8b5ed6..f5eacaaf6cd03221c7ef2d34547c35a3be0e2d4f 100644 --- a/layouts/partials/posts/post-infos.html +++ b/layouts/partials/posts/post-infos.html @@ -1,6 +1,6 @@ <ul class="post-infos"> {{ if .Params.posts_categories }} - <li> + <li class="terms"> <span>{{ i18n "posts.category" ( len .Params.posts_categories ) }}</span> {{ partial "posts/categories.html" . }} </li> diff --git a/layouts/partials/projects/categories.html b/layouts/partials/projects/categories.html new file mode 100644 index 0000000000000000000000000000000000000000..ffd783f24c83bdb9d034e4bdfeee49a8f297f60c --- /dev/null +++ b/layouts/partials/projects/categories.html @@ -0,0 +1,12 @@ +{{ $categories := .GetTerms "projects_categories" }} +{{- if $categories -}} +<ul class="project-categories"> + {{- range $categories -}} + <li> + <a href="{{ .Permalink }}"> + {{- safeHTML .Title -}} + </a> + </li> + {{- end }} +</ul> +{{- end -}} diff --git a/layouts/partials/projects/hero-list.html b/layouts/partials/projects/hero-list.html new file mode 100644 index 0000000000000000000000000000000000000000..84b8de2d9433fadeaf98bbe1933e228bfe7b5208 --- /dev/null +++ b/layouts/partials/projects/hero-list.html @@ -0,0 +1,8 @@ +{{- $title := or .Params.header_text .Title -}} +{{- partial "header/hero.html" + (dict + "title" $title + "image" .Params.image + "sizes" site.Params.image_sizes.sections.projects.hero + "context" . + ) -}} diff --git a/layouts/partials/projects/hero-single.html b/layouts/partials/projects/hero-single.html new file mode 100644 index 0000000000000000000000000000000000000000..e8bfe9f6240f203385fe3b598991974813037fd0 --- /dev/null +++ b/layouts/partials/projects/hero-single.html @@ -0,0 +1,9 @@ +{{- $title := or .Params.header_text .Title -}} +{{- partial "header/hero.html" + (dict + "title" $title + "image" .Params.image + "sizes" site.Params.image_sizes.sections.projects.hero_single + "hero_text_complement" "projects/project-infos.html" + "context" . + ) -}} diff --git a/layouts/partials/projects/project-infos.html b/layouts/partials/projects/project-infos.html new file mode 100644 index 0000000000000000000000000000000000000000..e33502c59b879e6ca8e207d9a43fea21e81410ed --- /dev/null +++ b/layouts/partials/projects/project-infos.html @@ -0,0 +1,18 @@ +<ul class="project-infos"> + {{ if .Params.projects_categories }} + <li class="terms"> + <span>{{ i18n "projects.category" ( len .Params.projects_categories ) }}</span> + {{ partial "projects/categories.html" . }} + </li> + {{ end }} + {{ with .Params.year }} + <li> + <span>{{ i18n "projects.year" }}</span> + <time datetime="{{ . }}">{{ . }}</time> + </li> + {{ end }} + <li class="social-share"> + <span>{{ i18n "projects.share" }}</span> + {{ partial "commons/share.html" . }} + </li> +</ul> \ No newline at end of file diff --git a/layouts/partials/projects/project.html b/layouts/partials/projects/project.html new file mode 100644 index 0000000000000000000000000000000000000000..c7ec5b2829b8440a7bacdaf57a5554e731d6bb09 --- /dev/null +++ b/layouts/partials/projects/project.html @@ -0,0 +1,50 @@ +{{ $project := .project }} +{{ $heading := .heading | default "h2" }} +{{ $heading_tag := (dict + "open" ((printf "<%s itemprop='name'>" $heading) | safeHTML) + "close" ((printf "</%s>" $heading) | safeHTML) + ) }} + +{{ with $project }} + +<article class="project" itemscope itemtype="https://schema.org/CreativeWork"> + + <div class="project-content"> + {{- $title := partial "PrepareHTML" .Title -}} + + {{ $heading_tag.open }} + <a href="{{ .Permalink }}" itemprop="url" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a> + {{ $heading_tag.close }} + + {{ if and site.Params.projects.index.show_description (partial "GetTextFromHTML" .Params.summary) }} + <p itemprop="abstract">{{ partial "GetTruncateContent" ( dict + "text" .Params.summary + "length" site.Params.projects.index.truncate_description + ) }}</p> + {{ end }} + + {{ if site.Params.projects.index.show_categories }} + {{- partial "projects/categories" . -}} + {{ end }} + + {{ if and site.Params.projects.index.show_year .Params.year }} + <div class="project-meta"> + <time itemprop="datePublished" datetime="{{ .Params.year }}">{{ .Params.year }}</time> + </div> + {{ end }} + </div> + + <div class="media"> + {{- if .Params.image -}} + {{- partial "commons/image.html" + (dict + "image" .Params.image + "sizes" site.Params.image_sizes.sections.projects.item + ) -}} + {{- else -}} + {{- partial "commons/image-default.html" "projects" -}} + {{- end -}} + </div> + +</article> +{{ end }} \ No newline at end of file diff --git a/layouts/partials/projects/projects.html b/layouts/partials/projects/projects.html new file mode 100644 index 0000000000000000000000000000000000000000..bfce05b018c0d2059cba468af1ef26bfbfa5625d --- /dev/null +++ b/layouts/partials/projects/projects.html @@ -0,0 +1,8 @@ +<div class="projects projects--{{- site.Params.projects.index.layout -}}"> + {{ if not .Pages }} + <p>{{ i18n "categories.no_project" }}</p> + {{ end }} + {{ range .Paginator.Pages }} + {{ partial "projects/project.html" (dict "project" . )}} + {{ end }} +</div> diff --git a/layouts/partials/projects/sidebar.html b/layouts/partials/projects/sidebar.html new file mode 100644 index 0000000000000000000000000000000000000000..2f27a098fd7676996c77a580f49b2e3471ace1ff --- /dev/null +++ b/layouts/partials/projects/sidebar.html @@ -0,0 +1,14 @@ +<div class="section-sidebar project-sidebar"> + <div> + <aside> + {{- partial "projects/project-infos.html" . -}} + </aside> + + {{ partial "toc/container.html" + (dict + "toc" "toc/default.html" + "context" . + ) + }} + </div> +</div> diff --git a/layouts/partials/projects/summary.html b/layouts/partials/projects/summary.html new file mode 100644 index 0000000000000000000000000000000000000000..85e4edf81a14c7fedc7c790f755b91710a4d9224 --- /dev/null +++ b/layouts/partials/projects/summary.html @@ -0,0 +1 @@ +{{- partial "commons/summary-in-content.html" . -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 5523950f11e3c1ff4e8a53d5aa63400e7ccabc66..d37649dfa59ca5c2ea16fd6cdcda0d4f0eaa11a0 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -6,7 +6,6 @@ <meta itemprop="url" content="{{ .Permalink }}"> {{ with .Date }}<meta itemprop="datePublished" content="{{ .Format "2006-01-02T15:04" }}">{{ end }} {{ with .Params.summary }}<meta itemprop="abstract" content="{{ . | safeHTML }}">{{ end }} - {{ with .Summary }}<meta itemprop="description" content="{{ . | safeHTML }}">{{ end }} {{ partial "posts/sidebar.html" . }} diff --git a/layouts/programs/list.html b/layouts/programs/list.html index 33406b15b666bdd13c88d3ec708f91cfe16c5185..0b2260601999fdd12a1dc2e1eaa755c58db4f7dc 100644 --- a/layouts/programs/list.html +++ b/layouts/programs/list.html @@ -2,7 +2,7 @@ {{ if eq .File.Path "programs/_index.html" }} {{ partial "programs/hero.html" . }} {{ partial "programs/list.html" . }} -{{ else }} + {{ else }} {{ partial "programs/hero-single.html" . }} {{ partial "programs/single.html" . }} {{ end }} diff --git a/layouts/projects/list.html b/layouts/projects/list.html new file mode 100644 index 0000000000000000000000000000000000000000..ea5fdbb7608debb02ba021ca82920def0e663f65 --- /dev/null +++ b/layouts/projects/list.html @@ -0,0 +1,18 @@ +{{ define "main" }} + {{ partial "projects/hero-list.html" . }} + <div class="document-content"> + {{ partial "commons/list-content.html" . }} + + {{ partial "projects/summary.html" (dict + "with_container" true + "context" . + ) }} + + {{ partial "contents/list.html" . }} + + <div class="container"> + {{ partial "projects/projects.html" . }} + {{ partial "commons/pagination.html" . }} + </div> + </div> +{{ end }} diff --git a/layouts/projects/single.html b/layouts/projects/single.html new file mode 100644 index 0000000000000000000000000000000000000000..05484c8bc2884bbf5837c6373ecf5da2df02eecf --- /dev/null +++ b/layouts/projects/single.html @@ -0,0 +1,24 @@ +{{ define "main" }} + {{ partial "projects/hero-single.html" . }} + + <div class="document-content" itemscope itemtype="https://schema.org/CreativeWork"> + <meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}"> + <meta itemprop="url" content="{{ .Permalink }}"> + {{ with .Params.summary }}<meta itemprop="description" content="{{ . | safeHTML }}">{{ end }} + + {{ partial "projects/summary.html" (dict + "context" . + "block_wrapped" true + ) }} + + {{ partial "contents/list.html" . }} + + {{ partial "commons/siblings-navigation.html" (dict + "context" . + "previous_label" (i18n "projects.previous") + "next_label" (i18n "projects.next") + ) }} + + {{ partial "hooks/before-document-content-end.html" . }} + </div> +{{ end }} diff --git a/layouts/projects_categories/list.html b/layouts/projects_categories/list.html new file mode 100644 index 0000000000000000000000000000000000000000..dc40e99731e7e266dd5cfe56cd0fd6eff130e318 --- /dev/null +++ b/layouts/projects_categories/list.html @@ -0,0 +1,10 @@ +{{ define "main" }} + {{ partial "categories/hero-list.html" . }} + + <div class="document-content"> + <div class="container"> + {{ partial "categories/categories.html" . }} + {{ partial "commons/pagination.html" . }} + </div> + </div> +{{ end }} diff --git a/layouts/projects_categories/term.html b/layouts/projects_categories/term.html new file mode 100644 index 0000000000000000000000000000000000000000..3e262d032938c69869a8891ace1f2de7428d7b90 --- /dev/null +++ b/layouts/projects_categories/term.html @@ -0,0 +1,22 @@ +{{ define "main" }} + {{ partial "categories/hero-term.html" . }} + + <div class="document-content"> + {{ partial "toc/container.html" (dict + "toc" "toc/default.html" + "context" . + ) }} + + {{ partial "categories/summary.html" (dict + "context" . + "block_wrapped" true + ) }} + + {{ partial "contents/list.html" . }} + + <div class="container"> + {{ partial "projects/projects.html" . }} + {{ partial "commons/pagination.html" . }} + </div> + </div> +{{ end }} diff --git a/static/osuny-theme-version b/static/osuny-theme-version index 9773998bc1b445500c00b2b39f8009a4b36d0250..4a2ecbb14995b98b5fb9fac97d6d48e192188d68 100644 --- a/static/osuny-theme-version +++ b/static/osuny-theme-version @@ -1 +1 @@ -v6.0.0 +v6.0.3 \ No newline at end of file