diff --git a/.github/workflows/test-with-example.yml b/.github/workflows/test-with-example.yml index ee46c094409b91e719266d2bc7cd560233179e38..3190dd0428ab6424c214ffa72d9fb6a0bc133a48 100644 --- a/.github/workflows/test-with-example.yml +++ b/.github/workflows/test-with-example.yml @@ -2,7 +2,7 @@ name: Test with example on: pull_request: - types: [opened, reopened] + types: [opened, reopened, synchronize] jobs: build: @@ -32,4 +32,4 @@ jobs: echo "== Pushing branch ==" git add . git commit -m "Updated theme to ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} branch." - git push -f origin theme--${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} \ No newline at end of file + git push -f origin theme--${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 192ada95f83b1e93671ff0d02aa0e544a67abad2..f0ceb48b1ac3086d82dafb48da59ba10166be3b4 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -25,7 +25,7 @@ jobs: - name: Commit & Push uses: Andro999b/push@v1.3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.OSUNY_BOT_GITHUB_TOKEN }} branch: main force: true message: 'Write version to file' @@ -40,4 +40,4 @@ jobs: uses: dkershner6/post-api-call-action@v1 with: url: ${{ secrets.OSUNY_STAGING_API_AUTOUPDATE_THEME_URL }} - data: "{\"secret_key\":\"${{ secrets.OSUNY_API_AUTOUPDATE_THEME_KEY }}\"}" \ No newline at end of file + data: "{\"secret_key\":\"${{ secrets.OSUNY_API_AUTOUPDATE_THEME_KEY }}\"}" 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 3d322e30e236f433d7f5afd2f84682fc0c7fa6c3..e202a63539355ac22bfe91d12c5e05837dfe9ce7 100644 --- a/assets/sass/_theme/_configuration.sass +++ b/assets/sass/_theme/_configuration.sass @@ -9,7 +9,7 @@ $color-selection: $color-background !default $color-selection-background: rgba($color-text, .7) !default // Scheme Dark colors (enable dark mode in your hugo configuration file) -$has-dark-mode: true +$has-dark-mode: false !default $color-dark-accent: rgb(120, 208, 255) !default $color-dark-text: #ffffff !default $color-dark-text-alt: #cbcbcb !default @@ -61,7 +61,7 @@ $h1-font-family: $heading-font-family !default $h1-size-desktop: pxToRem(60) !default $h1-size: pxToRem(30) !default $h1-line-height: 120% !default -$h1-line-height-desktop: 120% !default +$h1-line-height-desktop: $h1-line-height !default $h1-weight: bold !default $h1-text-transform: none !default @@ -70,7 +70,7 @@ $h2-font-family: $heading-font-family !default $h2-size-desktop: pxToRem(40) !default $h2-size: pxToRem(24) !default $h2-line-height: 120% !default -$h2-line-height-desktop: 120% !default +$h2-line-height-desktop: $h2-line-height !default $h2-weight: $heading-font-weight !default $h2-text-transform: none !default @@ -79,7 +79,7 @@ $h3-font-family: $heading-font-family !default $h3-size-desktop: pxToRem(28) !default $h3-size: pxToRem(20) !default $h3-line-height: 130% !default -$h3-line-height-desktop: 130% !default +$h3-line-height-desktop: $h3-line-height !default $h3-weight: bold !default $h3-text-transform: none !default @@ -88,7 +88,7 @@ $h4-font-family: $heading-font-family !default $h4-size-desktop: pxToRem(22) !default $h4-size: pxToRem(16) !default $h4-line-height: 130% !default -$h4-line-height-desktop: 130% !default +$h4-line-height-desktop: $h4-line-height !default $h4-weight: bold !default $h4-text-transform: none !default @@ -97,7 +97,7 @@ $h5-font-family: $heading-font-family !default $h5-size-desktop: pxToRem(24) !default $h5-size: pxToRem(20) !default $h5-line-height: 130% !default -$h5-line-height-desktop: 130% !default +$h5-line-height-desktop: $h5-line-height !default $h5-weight: $heading-font-weight !default $h5-text-transform: uppercase !default @@ -106,7 +106,7 @@ $h6-font-family: $heading-font-family !default $h6-size-desktop: pxToRem(20) !default $h6-size: pxToRem(14) !default $h6-line-height: 130% !default -$h6-line-height-desktop: 130% !default +$h6-line-height-desktop: $h6-line-height !default $h6-weight: $heading-font-weight !default $h6-text-transform: uppercase !default @@ -115,28 +115,28 @@ $lead-font-family: $heading-font-family !default $lead-size-desktop: pxToRem(60) !default $lead-size: pxToRem(24) !default $lead-line-height: 120% !default -$lead-line-height-desktop: 120% !default +$lead-line-height-desktop: $lead-line-height !default $lead-weight: $heading-font-weight !default $lead-sidebar-font-family: $lead-font-family !default $lead-sidebar-size-desktop: pxToRem(32) !default $lead-sidebar-size: $lead-size !default $lead-sidebar-line-height: $lead-line-height !default -$lead-sidebar-line-height-desktop: $lead-line-height-desktop !default +$lead-sidebar-line-height-desktop: $lead-sidebar-line-height !default $lead-sidebar-weight: $lead-weight !default $lead-hero-font-family: $lead-sidebar-font-family !default $lead-hero-size: $lead-size !default $lead-hero-size-desktop: $lead-sidebar-size-desktop !default $lead-hero-line-height: $lead-sidebar-line-height !default -$lead-hero-line-height-desktop: $lead-sidebar-line-height-desktop !default +$lead-hero-line-height-desktop: $lead-hero-line-height !default $lead-hero-weight: $lead-sidebar-weight !default // Body $body-size-desktop: pxToRem(22) !default $body-size: pxToRem(18) !default $body-line-height: 160% !default -$body-line-height-desktop: 160% !default +$body-line-height-desktop: $body-line-height !default $body-weight: normal !default // Small @@ -144,7 +144,7 @@ $small-font-family: $body-font-family !default $small-size-desktop: pxToRem(18) !default $small-size: pxToRem(14) !default $small-line-height: 130% !default -$small-line-height-desktop: 130% !default +$small-line-height-desktop: $small-line-height !default $small-weight: normal !default // Signature @@ -152,7 +152,7 @@ $signature-font-family: $heading-font-family !default $signature-size-desktop: pxToRem(22) !default $signature-size: pxToRem(18) !default $signature-line-height: 130% !default -$signature-line-height-desktop: 130% !default +$signature-line-height-desktop: $signature-line-height !default $signature-weight: $heading-font-weight !default // Meta @@ -160,7 +160,7 @@ $meta-font-family: $heading-font-family !default $meta-size-desktop: pxToRem(16) !default $meta-size: pxToRem(14) !default $meta-line-height: 150% !default -$meta-line-height-desktop: 150% !default +$meta-line-height-desktop: $meta-line-height !default $meta-weight: $heading-font-weight !default // Quotes @@ -170,7 +170,7 @@ $quote-size-desktop-long: pxToRem(40) !default $quote-size-desktop: pxToRem(40) !default $quote-size: pxToRem(24) !default $quote-line-height: 120% !default -$quote-line-height-desktop: 120% !default +$quote-line-height-desktop: $quote-line-height !default $quote-weight: normal !default $quote-style: italic !default @@ -357,9 +357,27 @@ $table-head-font-size-desktop: $h4-size-desktop !default $table-body-size: $body-size !default $table-body-size-desktop: $body-size-desktop !default +// HEADING + +// Under desktop breakpoint +$heading-margin-top: $spacing-4 !default +$heading-margin-bottom: 0 !default +// Upper desktop breakpoint without sidebar +$heading-margin-top-desktop: $spacing-6 !default +$heading-margin-bottom-desktop: $heading-margin-bottom !default +// Upper desktop breakpoint with sidebar +$heading-margin-top-with-sidebar: $spacing-5 !default +$heading-margin-bottom-with-sidebar: $heading-margin-bottom !default + // BLOCKS // Base -$block-space-y: $spacing-5 !default + +// Under desktop breakpoint +$block-space-y: $spacing-4 !default +// Upper desktop breakpoint without sidebar +$block-space-y-desktop: $spacing-5 !default +// Upper desktop breakpoint with sidebar +$block-space-y-with-sidebar: $spacing-5 !default // Block call to action $block-call-to-action-background: var(--color-accent) !default @@ -392,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 diff --git a/assets/sass/_theme/blocks/base.sass b/assets/sass/_theme/blocks/base.sass index 29c3754af22d6d8851ae5dbeeab48006f641c81a..1c231475e64557e3718fc1936f1c724f770b96e2 100644 --- a/assets/sass/_theme/blocks/base.sass +++ b/assets/sass/_theme/blocks/base.sass @@ -1,6 +1,7 @@ .block - margin-top: $block-space-y - margin-bottom: $block-space-y + --block-space-y: #{$block-space-y} + margin-top: var(--block-space-y) + margin-bottom: var(--block-space-y) .block-title @include h5 .top @@ -9,12 +10,23 @@ margin-top: $spacing-3 .block-title.hidden + .description margin-top: 0 + @include in-page-without-sidebar + --block-space-y: #{$block-space-y-desktop} + @include in-page-with-sidebar + --block-space-y: #{$block-space-y-with-sidebar} .heading + --heading-margin-top: #{$heading-margin-top} + --heading-margin-bottom: #{$heading-margin-bottom} + margin-bottom: var(--heading-margin-bottom) &:not(:first-child) - margin-top: $spacing-5 + margin-top: var(--heading-margin-top) + @include in-page-with-sidebar + --heading-margin-top: #{ $heading-margin-top-with-sidebar} + --heading-margin-bottom: #{$heading-margin-bottom-with-sidebar} @include in-page-without-sidebar - margin-top: $spacing-6 + --heading-margin-top: #{ $heading-margin-top-desktop} + --heading-margin-bottom: #{$heading-margin-bottom-desktop} @include in-page-without-sidebar h2 width: columns(8) diff --git a/assets/sass/_theme/blocks/call_to_action.sass b/assets/sass/_theme/blocks/call_to_action.sass index 588638c4ac58abcb886f5f6d4cd19bd9e29ade49..aa1ec4a787fd00f9505f556b321ff7d68ff3593a 100644 --- a/assets/sass/_theme/blocks/call_to_action.sass +++ b/assets/sass/_theme/blocks/call_to_action.sass @@ -53,7 +53,7 @@ padding-top: 0 padding-bottom: 0 .call_to_action - padding: $spacing-5 0 + padding: var(--block-space-y) 0 .actions a &:last-child @@ -77,7 +77,7 @@ > div // TODO : simplifier l'application d'une couleur de fond sur le CTA avec sidebar et sans sidebar background-color: var(--cta-background-color) - padding: var(--grid-gutter) columns(1) + padding: columns(1) width: 100% position: relative &::after 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/pages.sass b/assets/sass/_theme/blocks/pages.sass index 1f09a9ae46cb9213c88ceebbb293fb4713985dbe..c9a72db899d7ac88386fe5461403da1e9ca127f1 100644 --- a/assets/sass/_theme/blocks/pages.sass +++ b/assets/sass/_theme/blocks/pages.sass @@ -158,10 +158,9 @@ .block-content .top margin-bottom: $spacing-3 - // .description - // margin-bottom: $spacing-4 ul.title-only - @include grid(2, desktop) + @include grid(2, desktop, 0) + display: flex li margin-top: 0 a diff --git a/assets/sass/_theme/blocks/persons.sass b/assets/sass/_theme/blocks/persons.sass index b4ed98d2f78f69f2a9e8ad7dd30298592b53e98f..2956bae9e064e42634ba82d42edbdf7b25c3350f 100644 --- a/assets/sass/_theme/blocks/persons.sass +++ b/assets/sass/_theme/blocks/persons.sass @@ -4,7 +4,7 @@ gap: $spacing-3 .avatar margin-right: 0 - width: columns(4) + width: columns(2) .description margin-top: $spacing-3 text-align: left diff --git a/assets/sass/_theme/blocks/posts.sass b/assets/sass/_theme/blocks/posts.sass index dcc58c88f3eb24e31c928aaba42ab5cf88b401f0..734570f13af6d77173dd624ea605e1260048a583 100644 --- a/assets/sass/_theme/blocks/posts.sass +++ b/assets/sass/_theme/blocks/posts.sass @@ -18,7 +18,7 @@ margin-top: $spacing-2 .media margin-top: 0 - @include post-time-author-flex + @include author-and-time-side-to-side &--grid @include media-breakpoint-down(desktop) @@ -36,14 +36,22 @@ .post .more @include icon(arrow-right, after, true) - .post-author + + // Masquer le point entre l'auteur et la date (mixin author-and-time-side-to-side) + .post-author p::before display: none + + // Permet d'aligner correctement les différents line-height des différents composants du post meta .post-meta display: block - line-height: 0 + line-height: 0 // Hack pour que les enfants de post-meta soient correctement .post-categories * display: inline + // Désactiver le ratio forcé de la configuration $article-media-aspect-ratio + .media + &, img + aspect-ratio: auto @include media-breakpoint-down(desktop) .post + .post @@ -64,10 +72,10 @@ gap: var(--grid-gutter) + .post margin-top: $spacing-4 + .post-title + @include h2 p[itemprop="articleBody"] margin-top: $spacing-3 - &-title - @include h2 .post-meta > * display: inline @@ -103,6 +111,8 @@ width: columns(6) .post-content width: columns(5) + .post-title + @include lead p[itemprop="articleBody"] margin-top: calc(#{$spacing-3} + #{$spacing-2}) &--list 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/summary.sass b/assets/sass/_theme/blocks/summary.sass index 8d40c67a5e00b4232e5e621787161712d3fed037..93be875c8e2a3967fc2590e713f69ee5bd2f4aae 100644 --- a/assets/sass/_theme/blocks/summary.sass +++ b/assets/sass/_theme/blocks/summary.sass @@ -6,5 +6,4 @@ padding-top: 0 @include in-page-without-sidebar - padding-top: 0 - margin-top: $block-space-y \ No newline at end of file + padding-top: 0 \ No newline at end of file diff --git a/assets/sass/_theme/blocks/timeline.sass b/assets/sass/_theme/blocks/timeline.sass index 4f6036655fd3662cdabf250eaa9825d70bdee5e8..cb1be7fde5adc3a16af27eeae3d81ab2de5a9804 100644 --- a/assets/sass/_theme/blocks/timeline.sass +++ b/assets/sass/_theme/blocks/timeline.sass @@ -65,8 +65,8 @@ --min-title-height: 0px background: $block-timeline-horizontal-background color: $block-timeline-horizontal-color - padding-bottom: var(--grid-gutter) - padding-top: var(--grid-gutter) + padding-bottom: var(--block-space-y) + padding-top: var(--block-space-y) &::before display: none .timeline-event @@ -111,13 +111,13 @@ .actions-arrows left: 0 position: absolute - top: calc(#{$spacing-4/2} + var(--min-title-height)) + top: calc(#{$spacing-2} + var(--min-title-height)) .timeline-event margin-right: 0 padding-right: 0 width: 75% .line - margin-bottom: calc(#{$spacing-4} + var(--min-title-height)) + margin-bottom: $spacing-5 @include in-page-without-sidebar @include media-breakpoint-up(xxl) diff --git a/assets/sass/_theme/design-system/breadcrumb.sass b/assets/sass/_theme/design-system/breadcrumb.sass index 64358a15f58d2ae5e4f8eb9616ac3ee6ab7c70b9..f5775c0fdd90a37dd0572966fd10e55bfe5df411 100644 --- a/assets/sass/_theme/design-system/breadcrumb.sass +++ b/assets/sass/_theme/design-system/breadcrumb.sass @@ -22,3 +22,10 @@ @include icon($breadcrumb-icon) padding-right: $spacing-2 color: $breadcrumb-icon-color + +.breadcrumb-nav + @include media-breakpoint-down(desktop) + margin-left: var(--grid-gutter-negative) + margin-right: var(--grid-gutter-negative) + > ol + padding: 0 var(--grid-gutter) \ No newline at end of file diff --git a/assets/sass/_theme/design-system/button.sass b/assets/sass/_theme/design-system/button.sass index ded58e8c578d94af103161553e4ac03392990604..bae206c7cd3f03235d86a9d88dd8e83969d4b5ae 100644 --- a/assets/sass/_theme/design-system/button.sass +++ b/assets/sass/_theme/design-system/button.sass @@ -37,13 +37,13 @@ @include meta @include button-reset align-items: center + color: var(--color-text) cursor: pointer display: flex padding: 0 - &:first-child - margin-bottom: $spacing-2 + text-decoration: none &::before - background-color: white + background-color: var(--color-background) border: 1px solid var(--color-border) margin-right: $spacing-2 padding: $spacing-1 @@ -56,13 +56,7 @@ background-color: var(--color-text) border-color: transparent color: var(--color-background) - text-decoration: none - -button.squared-button - @include icon-block(eye, before) -a.squared-button - @include icon-block(download, before) // TODO: check usage in journal .link-btn @@ -113,6 +107,6 @@ a.squared-button text-align: center a display: block - color: var(--btn-color) + color: var(--btn-hover-color) &:hover color: var(--color-accent) diff --git a/assets/sass/_theme/design-system/footer.sass b/assets/sass/_theme/design-system/footer.sass index a8b276755467abe7d3476c1b259c74e8d0fc8b5a..f0870a8a1db94df86db86b976b4d8d0c80ab2ec6 100644 --- a/assets/sass/_theme/design-system/footer.sass +++ b/assets/sass/_theme/design-system/footer.sass @@ -18,12 +18,8 @@ footer#document-footer height: $footer-logo-height-desktop ul @include list-reset - li - + li + li + li margin-top: $spacing-2 - a - // @include link($footer-color) - @extend %underline-on-hover .footer &-site @include small @@ -34,6 +30,8 @@ footer#document-footer &-credit display: block margin-top: $spacing-2 + a + text-decoration-color: alphaColor(currentColor, 0.3) &-search padding-top: $spacing-2 !important &-i18n diff --git a/assets/sass/_theme/design-system/hero.sass b/assets/sass/_theme/design-system/hero.sass index 17f7432f608f647b403aae806189fc4b3ae52c1f..2231ea2659bb27611337e57ef9c80877cc533726 100644 --- a/assets/sass/_theme/design-system/hero.sass +++ b/assets/sass/_theme/design-system/hero.sass @@ -41,12 +41,12 @@ margin-bottom: 0 & + .document-content margin-top: $spacing-5 + &--with-image + figure + position: relative + > a + @include stretched-link @include media-breakpoint-down(desktop) - .breadcrumb-nav - margin-left: var(--grid-gutter-negative) - margin-right: var(--grid-gutter-negative) - > ol - padding: 0 var(--grid-gutter) &--with-image padding-bottom: 0 .content @@ -90,4 +90,6 @@ width: columns(3) + .breadcrumb-container margin-top: 0 + @include media-breakpoint-down(desktop) + margin-bottom: $spacing-5 diff --git a/assets/sass/_theme/design-system/layout.sass b/assets/sass/_theme/design-system/layout.sass index bf104e3335b8da814a1649c81edd9ad70dcd45b1..d4205042f2cc913177708242d6e50fc7b963bfc6 100644 --- a/assets/sass/_theme/design-system/layout.sass +++ b/assets/sass/_theme/design-system/layout.sass @@ -4,12 +4,13 @@ box-sizing: border-box \:root - --spacing0: #{$spacing-2} - --spacing1: #{$spacing-3} - --spacing2: #{$spacing-4} - --spacing3: #{$spacing-5} - --spacing4: #{$spacing-6} - --spacing5: #{$spacing-7} + --spacing-1: #{$spacing-1} + --spacing-2: #{$spacing-2} + --spacing-3: #{$spacing-3} + --spacing-4: #{$spacing-4} + --spacing-5: #{$spacing-5} + --spacing-6: #{$spacing-6} + --spacing-7: #{$spacing-7} --grid-max-width: #{$grid-max-width} --header-height: #{$header-height} --header-menu-max-height: calc(100vh - var(--header-height) - #{$spacing-6}) diff --git a/assets/sass/_theme/design-system/logo.sass b/assets/sass/_theme/design-system/logo.sass index 99192af969b7597672b897db8e72e6d89c56a2cf..6aafea148625fb6dff2174a60af8077acbae64d5 100644 --- a/assets/sass/_theme/design-system/logo.sass +++ b/assets/sass/_theme/design-system/logo.sass @@ -8,8 +8,9 @@ display: none .logo-text @include h2 - @media (prefers-color-scheme: dark) - > img:first-child - display: none - .logo-darkmode - display: block \ No newline at end of file + &.with-darkmode + @media (prefers-color-scheme: dark) + > img:first-child + display: none + .logo-darkmode + display: block \ No newline at end of file diff --git a/assets/sass/_theme/design-system/search.sass b/assets/sass/_theme/design-system/search.sass index 2d075daaeb476dd733e00e493ee9b7f4089b5057..844e04318e653f1078ac00413b2263d339ae72fd 100644 --- a/assets/sass/_theme/design-system/search.sass +++ b/assets/sass/_theme/design-system/search.sass @@ -85,7 +85,7 @@ &__form @include icon(search-inline, after) &::after - color: alphaColor(var(--color-text-alt), .6) + color: alphaColor(var(--color-text-alt), 0.6) position: fixed pointer-events: none z-index: 9 diff --git a/assets/sass/_theme/design-system/typography.sass b/assets/sass/_theme/design-system/typography.sass index f9a48febf75864525751e1fd04620bc630b1d1e4..e08b6c2ab1e7e40f23d89c12031c9b4e85349b98 100644 --- a/assets/sass/_theme/design-system/typography.sass +++ b/assets/sass/_theme/design-system/typography.sass @@ -244,7 +244,7 @@ a, margin-right: pxToRem(5) %underline-on-hover - text-decoration-color: alphaColor(currentColor, 0) + text-decoration-color: transparent text-decoration-thickness: $link-underline-thickness text-underline-offset: $link-underline-offset transition: $link-transition diff --git a/assets/sass/_theme/sections/events.sass b/assets/sass/_theme/sections/events.sass index 9394569331c887b2896a7d22bfbd0735e42c6fd7..37842f429c0803c21086bbb9e10d67104fbdb7e2 100644 --- a/assets/sass/_theme/sections/events.sass +++ b/assets/sass/_theme/sections/events.sass @@ -143,12 +143,13 @@ gap: var(--grid-gutter) align-items: start &-content - width: columns(10) > hgroup, > .event-title margin-bottom: $spacing-2 .media order: 2 @include in-page-without-sidebar + &-content + width: columns(10) &-dates margin-top: 0 order: 0 @@ -266,6 +267,12 @@ align-items: center &-dates @include h3 + .event-title, + .event-subtitle, + hgroup + @include lead + .media + width: columns(6) &:not(.event--with-image) width: columns(5) margin-left: offset(4) diff --git a/assets/sass/_theme/sections/organizations.sass b/assets/sass/_theme/sections/organizations.sass index c468c7e5dfff9fa46661538e921a410308b57ce2..cfdf77b8b406f17d481558b6c7e95ff886491d0c 100644 --- a/assets/sass/_theme/sections/organizations.sass +++ b/assets/sass/_theme/sections/organizations.sass @@ -57,7 +57,7 @@ @include media-breakpoint-up(desktop) font-size: $lead-sidebar-size-desktop .document-content - .logo-organization + .organization-logo figcaption text-align: right @include meta @@ -81,7 +81,7 @@ @include grid(2, md) @include media-breakpoint-down(md) .document-content - .logo-organization + .organization-logo margin-top: $spacing-5 display: flex justify-content: space-between @@ -93,5 +93,5 @@ gap: var(--grid-gutter) [itemprop="articleBody"] width: columns(8) - .logo-organization + .organization-logo width: columns(3) diff --git a/assets/sass/_theme/sections/papers.sass b/assets/sass/_theme/sections/papers.sass index 427cbf18dd1546f1c6b75c7911037686f5e62e45..bc05573a56345b90390064b824745270ef7634a5 100644 --- a/assets/sass/_theme/sections/papers.sass +++ b/assets/sass/_theme/sections/papers.sass @@ -1,24 +1,10 @@ .paper display: flex gap: var(--grid-gutter) + flex-direction: column a transition: color 0.3s ease @extend %underline-on-hover - > div:first-of-type - width: columns(7) - .paper-actions - width: columns(5) - display: flex - align-items: start - gap: var(--grid-gutter) - button[data-open-modal] - width: columns(2) - figure - width: columns(3) - @include media-breakpoint-down(desktop) - flex-wrap: wrap - justify-content: space-between - margin-top: $spacing-3 h3 a:hover color: var(--color-accent) @@ -52,6 +38,18 @@ @include media-breakpoint-up(desktop) margin-top: $spacing-5 +.papers__section + .paper-actions + @include media-breakpoint-up(lg) + flex-direction: row + > div:first-of-type + width: columns(7) + .paper-actions + width: columns(5) + button[data-open-modal] + width: columns(2) + figure + width: columns(3) .papers__page @include media-breakpoint-down(desktop) .document-content @@ -149,6 +147,19 @@ padding-left: 0 padding-right: offset(4) +// Actions +.paper-actions + display: flex + align-items: start + gap: var(--grid-gutter) + @include media-breakpoint-down(desktop) + flex-wrap: wrap + gap: $spacing-3 + button.squared-button + @include icon-block(eye, before) + a.squared-button + @include icon-block(download, before) + .citations &:not(:first-child) margin-top: $spacing-5 diff --git a/assets/sass/_theme/sections/persons.sass b/assets/sass/_theme/sections/persons.sass index 7f743c2a9924e8d265deb0cb52e375298d6e76e0..e974002ddd117c0e9d5e26178148a333df31a5e4 100644 --- a/assets/sass/_theme/sections/persons.sass +++ b/assets/sass/_theme/sections/persons.sass @@ -16,7 +16,6 @@ margin-top: $spacing-1 .description @include small - @include media-breakpoint-down(lg) flex-direction: row gap: $spacing-3 @@ -38,7 +37,6 @@ .avatar width: 100% - section.persons, div.persons @include grid(1) @@ -46,8 +44,6 @@ div.persons @include grid(4, lg) @include grid(6, xxl) - - ol.persons--list @include list-reset > li @@ -127,34 +123,36 @@ ol.persons--list .persons__page .hero - figure - @extend .avatar - @include media-breakpoint-down(desktop) - padding-bottom: 0 - margin-bottom: $spacing-6 + &--with-image + .hero-text + margin-bottom: $spacing-3 figure - width: columns(6) - margin-top: $spacing-3 - margin-left: auto - transform: translateY(100px) - margin-top: calc(#{$spacing-3} - 100px) - @include media-breakpoint-down(sm) - margin-bottom: $spacing-6 - figure - transform: translateY(18vw) - margin-top: calc(#{$spacing-3} - 18vw) - @include media-breakpoint-up(desktop) - .content - align-items: center - display: flex - justify-content: space-between - margin-top: 0 - h1 - margin-bottom: 0 - width: columns(8) + @extend .avatar + @include media-breakpoint-down(desktop) + .container + margin-bottom: calc(#{columns(2)} + #{$spacing-5}) figure - margin-bottom: 0 - width: columns(3) + width: columns(4) + margin-left: auto + margin-bottom: calc(#{columns(2)} * -1) + @include media-breakpoint-down(md) + .container + margin-bottom: calc(#{columns(3)} + #{$spacing-5}) + figure + width: columns(6) + margin-bottom: calc(#{columns(3)} * -1) + @include media-breakpoint-up(desktop) + .content + align-items: center + display: flex + justify-content: space-between + margin-top: 0 + h1 + margin-bottom: 0 + width: columns(8) + figure + margin-bottom: 0 + width: columns(3) .roles a @include small diff --git a/assets/sass/_theme/sections/posts.sass b/assets/sass/_theme/sections/posts.sass index 25d8d8c57364f32e25443c0dff773d9ccc6efe39..6fb689aa5447238b9bc37e90969a5a2ef4aecaa7 100644 --- a/assets/sass/_theme/sections/posts.sass +++ b/assets/sass/_theme/sections/posts.sass @@ -72,7 +72,7 @@ @include grid(2, desktop) @include grid($posts-grid-columns, xxl) .post - @include post-time-author-flex + @include author-and-time-side-to-side .post-meta margin-top: $spacing-2 diff --git a/assets/sass/_theme/sections/volumes.sass b/assets/sass/_theme/sections/volumes.sass index bf603b2a522688cfc7e235024441b095ea7d86a0..2b3d83aa8ccf3d7d7bd92c5824a65d5a6f058b0e 100644 --- a/assets/sass/_theme/sections/volumes.sass +++ b/assets/sass/_theme/sections/volumes.sass @@ -37,18 +37,16 @@ &:not(:first-of-type) margin-top: $spacing-4 .paper - display: block - @include media-breakpoint-down(desktop) + gap: $spacing-3 + .paper-actions + > * + width: auto + @include media-breakpoint-down(xxl) > div:first-of-type .paper-volume display: inline-flex margin-left: $spacing-2 - @include media-breakpoint-up(desktop) + @include media-breakpoint-up(xxl) > div:first-of-type .paper-volume - padding-left: $spacing-3 - .paper-actions - gap: var(--grid-gutter) - margin-top: $spacing-2 - a, button - width: unset \ No newline at end of file + padding-left: $spacing-3 \ No newline at end of file diff --git a/assets/sass/_theme/utils/colors.sass b/assets/sass/_theme/utils/colors.sass index fb914a331c818061d2fae4f94640cbd44166007b..0c4d8aebadc48e79c8170a9bfb42b6860bd2288b 100644 --- a/assets/sass/_theme/utils/colors.sass +++ b/assets/sass/_theme/utils/colors.sass @@ -1,6 +1,9 @@ // Les couleurs étant stockées dans des variables CSS, nous utilisons color-mix pour appliquer de l'alpha sur des couleurs en hexa @function alphaColor($color, $alpha) $percent: $alpha - @if ($percent <= 1) + @if ($percent <= 1 and $percent > 0) $percent: $alpha * 100% - @return color-mix(in srgb, $color $percent, transparent) + @if ($percent == 0) // Permet d'éviter le bug de compilation en production qui renvoie "0" au lieu de "0%" + @return transparent + @else + @return color-mix(in srgb, $color $percent, transparent) diff --git a/assets/sass/_theme/utils/grid.sass b/assets/sass/_theme/utils/grid.sass index 20eabb832e78bf2160cf9160cbaa2e3d07540439..b7d5d2c1ab17f587f327af44ac30c40db72ce0b2 100644 --- a/assets/sass/_theme/utils/grid.sass +++ b/assets/sass/_theme/utils/grid.sass @@ -3,8 +3,8 @@ margin-right: auto padding-left: var(--grid-gutter) padding-right: var(--grid-gutter) - width: auto - max-width: var(--grid-width) + width: var(--grid-width) + max-width: 100% @function columns($quantity) $width: calc( (var(--column-width) * #{$quantity}) + var(--grid-gutter) * ( #{$quantity} - 1 )) diff --git a/assets/sass/_theme/utils/shame.sass b/assets/sass/_theme/utils/shame.sass index 141293ea9a9118bd3009ae549a0dec033b5908db..e6c0cdb5ca93291793dceb41da16d040a3d199ad 100644 --- a/assets/sass/_theme/utils/shame.sass +++ b/assets/sass/_theme/utils/shame.sass @@ -10,7 +10,7 @@ white-space: nowrap !important width: 1px !important -@mixin post-time-author-flex +@mixin author-and-time-side-to-side .post-meta display: flex flex-wrap: wrap diff --git a/bin/osuny.js b/bin/osuny.js index 15ff7e685afe69c3073ee87680832a6b354fa41e..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, - .pages__section, .block-pages, - .persons__section, .block-persons, - .posts__section, .block-posts, .post-sidebar, - .programs__section, .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 03e5a7d1aaeb25747ff203bdc784fb26be5adb7c..7d4777567cf81a3fc1503503167912f89406d83e 100644 --- a/config.yaml +++ b/config.yaml @@ -1,5 +1,7 @@ params: - debug: false + debug: + active: false + productionUrl: "" keycdn: https://osuny-1b4da.kxcdn.com cookie_banner: enable: false @@ -10,12 +12,15 @@ params: title: separator: "|" logo: - header: - default: "/assets/images/logo.svg" - darkmode: "/assets/images/logo-white.svg" - footer: - default: "/assets/images/logo.svg" - darkmode: "/assets/images/logo-white.svg" + header: "/assets/images/logo.svg" + footer: "/assets/images/logo.svg" + # Handle logo in darkmode with this configuration + # header: + # default: "/assets/images/logo.svg" + # darkmode: "/assets/images/logo-white.svg" + # footer: + # default: "/assets/images/logo.svg" + # darkmode: "/assets/images/logo-white.svg" menu: dropdown: linkToLevel1: false @@ -163,6 +168,10 @@ params: mobile: 170 tablet: 350 desktop: 415 + programs: + mobile: 400 + tablet: 800 + desktop: 600 sections: categories: hero: diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 8eb282a99f0f0ac2d2a2c009d7d82ec3b02f6f6c..be5a617e335b9542e19d090ef1a58d4e4dee369c 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -31,7 +31,7 @@ {{- partial "footer/plausible.html" . -}} {{- partial "footer/js.html" . -}} {{- partial "footer/script.html" . -}} - {{- if or (not hugo.IsProduction) site.Params.debug -}} + {{- if or (not hugo.IsProduction) site.Params.debug.active -}} {{- partial "footer/debug.html" . -}} {{- end -}} </body> 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/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/commons/image-default.html b/layouts/partials/commons/image-default.html index edfcc8229ec80e3f3d809709dff10153603ab5e9..302c39f770dae54aded02bcfa11b25aac74397ed 100644 --- a/layouts/partials/commons/image-default.html +++ b/layouts/partials/commons/image-default.html @@ -6,7 +6,6 @@ {{ with index site.Params.image_sizes.sections $section_type }} {{ $sizes := .item }} - {{ $sizes }} {{- partial "commons/image.html" (dict "image" $image diff --git a/layouts/partials/commons/logo.html b/layouts/partials/commons/logo.html index 2e83d1786179f8acf428c4fa9bfd901e56c29341..8fb88532d8784c3054596b51da77163317e4b5c2 100644 --- a/layouts/partials/commons/logo.html +++ b/layouts/partials/commons/logo.html @@ -8,7 +8,7 @@ {{ $file_darkmode = $logo.darkmode }} {{ end }} -<a class="logo" href="{{ site.Home.Permalink }}"> +<a class="logo {{- if $file_darkmode }} with-darkmode {{ end -}}" href="{{ site.Home.Permalink }}"> {{ if $file }} {{ $fileDimensions := partial "GetImageDimensions" (dict "context" . "file" $file "static" true) }} <img src="{{ $file }}" alt="{{ site.Title }}" height="{{ index $fileDimensions 1 }}" width="{{ index $fileDimensions 0 }}"> diff --git a/layouts/partials/footer/debug.html b/layouts/partials/footer/debug.html index 86fc5ac335c3293104e5a8f1b37a3bab76fdc987..2dc6e28a593fba575c8c177d9601c8f4c75826ad 100644 --- a/layouts/partials/footer/debug.html +++ b/layouts/partials/footer/debug.html @@ -1,3 +1,37 @@ +<div class="d-help"> + <a href="#help"> + <img src="/osuny/icon.png" alt="Aide Osuny" class="d-help__icon" /> + </a> + <div class="d-help__content" id="help"> + <table> + <thead> + <tr> + <th>Action</th> + <th>Raccourci</th> + </tr> + </thead> + <tbody> + <tr> + <td>Afficher la grille</td> + <td>Ctrl + g</td> + </tr> + <tr> + <td>Passer d’une page pleine largeur à une page avec barre latérale, et inversement</td> + <td>Ctrl + w</td> + </tr> + <tr> + <td>Contrôler les dimensions des images chargées</td> + <td>Ctrl + i</td> + </tr> + <tr> + <td>Ouvre la page en production, si dans config.yaml debug.productionUrl est spécifié</td> + <td>Ctrl + p</td> + </tr> + </tbody> + </table> + </div> +</div> + <div class="d-grid"> <div>1</div> <div>2</div> @@ -14,16 +48,37 @@ </div> <div class="d-spacing"> - <div><span>0 (12px) </span></div> - <div><span>1 (24px) </span></div> - <div><span>2 (48px) </span></div> - <div><span>3 (64px) </span></div> - <div><span>4 (128px) </span></div> - <div><span>5 (256px) </span></div> + <div><span>1 (8px) </span></div> + <div><span>2 (12px) </span></div> + <div><span>3 (24px) </span></div> + <div><span>4 (48px) </span></div> + <div><span>5 (64px) </span></div> + <div><span>6 (128px) </span></div> + <div><span>7 (256px) </span></div> </div> <div class="d-cross"></div> <style> + .d-help__content { + display: none; + background: #EEEEEE; + border-radius: 24px; + position: fixed; + width: 600px; + bottom: 10px; + left: 10px; + padding: 10px 20px 60px; + } + .d-help__content:target { + display: block; + } + .d-help__icon { + bottom: 10px; + left: 10px; + position: fixed; + width: 40px; + z-index: 1000; + } .d-grid { bottom: 0; display: none; @@ -49,10 +104,6 @@ } .d-grid > div { background: fuchsia; - /* - border-left: 1px solid yellow; - border-right: 1px solid yellow; - */ text-align: center; } .d-spacing { @@ -64,7 +115,7 @@ pointer-events: none; width: 100%; mix-blend-mode: difference; - opacity: 0.3; + opacity: 0.5; font-family: sans-serif; font-size: 12px; } @@ -76,6 +127,7 @@ } .d-spacing > div span { position: absolute; + color: var(--color-text); } .d-spacing > div { width: 100%; @@ -86,25 +138,28 @@ } .d-spacing > div:nth-child(1){ border-top: 1px solid white; - height: var(--spacing0); + height: var(--spacing-1); } .d-spacing > div:nth-child(1) span{ margin-top: -10px; } .d-spacing > div:nth-child(2){ - height: var(--spacing1); + height: var(--spacing-2); } .d-spacing > div:nth-child(3){ - height: var(--spacing2); + height: var(--spacing-3); } .d-spacing > div:nth-child(4){ - height: var(--spacing3); + height: var(--spacing-4); } .d-spacing > div:nth-child(5){ - height: var(--spacing4); + height: var(--spacing-5); } .d-spacing > div:nth-child(6){ - height: var(--spacing5); + height: var(--spacing-6); + } + .d-spacing > div:nth-child(7){ + height: var(--spacing-7); } .d-cross { position: fixed; @@ -275,7 +330,7 @@ function openInProd() { // To use this debug method, add params.productionUrl key to your hugo config.yaml - const productionUrl = "{{ site.Params.debug.productionUrl }}"; + const productionUrl = '{{ index site.Params.debug "productionUrl" }}'; if (productionUrl) { window.open(`${productionUrl}${window.location.pathname}`); } diff --git a/layouts/partials/head/csp.html b/layouts/partials/head/csp.html index 841a8a13eef10904e12f7d86738d8f5b263156b4..42e0bcbf7d6dfef5e0727f34c47b9ff123d74904 100644 --- a/layouts/partials/head/csp.html +++ b/layouts/partials/head/csp.html @@ -2,7 +2,7 @@ <meta http-equiv="Content-Security-Policy" content=" default-src 'self' {{ delimit . " " }} - {{ if or (not hugo.IsProduction) site.Params.debug }}'unsafe-inline'{{ end }} + {{ if or (not hugo.IsProduction) site.Params.debug.active }}'unsafe-inline'{{ end }} {{ if site.Params.search.active }}'wasm-unsafe-eval'{{ end }}; " /> {{- end -}} diff --git a/layouts/partials/header/hero.html b/layouts/partials/header/hero.html index af41832f8819bbdb1fd31807c30c793996d19964..35b8a46b6c24476b65c71cbd2dc00f28a1609bf4 100644 --- a/layouts/partials/header/hero.html +++ b/layouts/partials/header/hero.html @@ -47,30 +47,28 @@ {{ 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> @@ -81,7 +79,9 @@ {{ end }} {{ if and $display_breadcrumb (eq site.Params.breadcrumb.position "hero-end") }} - {{ partial "header/breadcrumbs.html" .context }} + <div class="container breadcrumb-container"> + {{ partial "header/breadcrumbs.html" .context }} + </div> {{ end }} </header> diff --git a/layouts/partials/persons/hero-single copy.html b/layouts/partials/persons/hero-single copy.html deleted file mode 100644 index da41ce5514a76c6bd68d4288dcb5467879e60f84..0000000000000000000000000000000000000000 --- a/layouts/partials/persons/hero-single copy.html +++ /dev/null @@ -1,43 +0,0 @@ -{{- $breadcrumb_is_after_hero := eq site.Params.breadcrumb.position "after-hero" -}} -{{ $subtitle := "" }} -{{- $summary := .Params.summary | safeHTML -}} -{{ if and (eq site.Params.summary.position "hero") $summary }} - {{ $subtitle = $summary }} -{{ end }} - -<header class="hero {{ if $breadcrumb_is_after_hero -}} hero--no-margin {{- end }}"> - <div class="container"> - {{- if eq site.Params.breadcrumb.position "hero-start" -}} - {{ partial "header/breadcrumbs.html" . }} - {{- end -}} - <div class="content"> - {{- if $subtitle -}} - <hgroup> - <h1>{{ partial "PrepareHTML" .Title }}</h1> - <p class="lead">{{ partial "PrepareHTML" $subtitle }}</p> - </hgroup> - {{- else -}} - <h1>{{ partial "PrepareHTML" .Title }}</h1> - {{- end -}} - - {{ if .Params.image }} - <div class="avatar"> - {{ partial "commons/image.html" - (dict - "image" .Params.image - "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 $breadcrumb_is_after_hero -}} - <div class="container breadcrumb-container"> - {{ partial "header/breadcrumbs.html" . }} - </div> -{{- end -}} \ No newline at end of file diff --git a/layouts/partials/persons/hero-single.html b/layouts/partials/persons/hero-single.html index a79151b4e11c71d79d6d46895a1d43b42b98c100..2c6f6e83111afb6bc29e93485425243df6be5455 100644 --- a/layouts/partials/persons/hero-single.html +++ b/layouts/partials/persons/hero-single.html @@ -1,8 +1,19 @@ {{- $title := or .Params.header_text .Title -}} + +{{/* LEGACY : à retirer une fois que le format de donnée des images des personnes sera homogène aux autres images */}} +{{- $image := "" -}} +{{ with .Params.image }} + {{ if eq (printf "%T" .) "string" }} + {{ $image = dict "id" . }} + {{ else }} + {{ $image = . }} + {{ end }} +{{ end }} + {{- partial "header/hero.html" (dict "title" $title - "image" (dict "id" .Params.image) + "image" $image "context" . "sizes" site.Params.image_sizes.sections.persons.hero_single ) -}} diff --git a/layouts/partials/programs/list.html b/layouts/partials/programs/list.html index ddd3d9be1a758789c95498e241221e834d0b42cb..0fccc9daa5c4cc4219349eada600c7ad8ea3d9bd 100644 --- a/layouts/partials/programs/list.html +++ b/layouts/partials/programs/list.html @@ -12,8 +12,12 @@ {{ partial "contents/list.html" . }} <div class="container"> {{ partial "diplomas/diplomas-select.html" . }} + {{/* Toutes les formations... */}} {{ $programs := where .Site.Pages "Section" "programs" }} + {{/* mais pas l'accueil des formations... */}} {{ $programs = where $programs "Permalink" "!=" .FirstSection.Permalink }} + {{/* et pas non plus les pages enfants (parcours) */}} + {{ $programs = where $programs "Params.parent" "eq" nil }} {{ partial "programs/programs-list.html" $programs }} </div> </div> diff --git a/layouts/persons/single.html b/layouts/persons/single.html index becf9384a25780d7e81763172a83e39c76b630fb..a7e24cb19d79641af29453ed213cd1ab7ee503a3 100644 --- a/layouts/persons/single.html +++ b/layouts/persons/single.html @@ -28,12 +28,18 @@ <div itemscope itemtype="https://schema.org/Person" class="container"> <meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}"> <meta itemprop="url" content="{{ .Permalink }}"> - {{- if .Params.image -}} - {{- $image := partial "GetMedia" .Params.image -}} - {{- if $image -}} - <meta itemprop="image" content="{{ $image.url }}"> + {{ with .Params.image }} + {{ $image_id := "" }} + {{/* LEGACY : à retirer une fois que le format de donnée des images des personnes sera homogène aux autres images */}} + {{ if eq (printf "%T" .) "string" }} + {{ $image_id = . }} + {{ else }} + {{ $image_id = index . "id" }} + {{ end }} + {{- with partial "GetMedia" $image_id -}} + <meta itemprop="image" content="{{ .url }}"> {{- end -}} - {{- end -}} + {{ end }} <div class="informations"> <div> 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/static/osuny-theme-version b/static/osuny-theme-version index 67e96b63ffe71b766b18857948830f2a6e1a91dc..9773998bc1b445500c00b2b39f8009a4b36d0250 100644 --- a/static/osuny-theme-version +++ b/static/osuny-theme-version @@ -1 +1 @@ -v5.2.1 \ No newline at end of file +v6.0.0 diff --git a/static/osuny/icon.png b/static/osuny/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..8037459303346a4f81c83af38646b8db06a26dc7 Binary files /dev/null and b/static/osuny/icon.png differ