diff --git a/.github/workflows/test-with-example.yml b/.github/workflows/test-with-example.yml new file mode 100644 index 0000000000000000000000000000000000000000..ee46c094409b91e719266d2bc7cd560233179e38 --- /dev/null +++ b/.github/workflows/test-with-example.yml @@ -0,0 +1,35 @@ +name: Test with example + +on: + pull_request: + types: [opened, reopened] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Set new submodule in new branch on Osuny Example + uses: actions/checkout@v4 + with: + repository: noesya/osuny-example + submodules: 'recursive' + token: ${{ secrets.OSUNY_EXAMPLE_TOKEN }} + - name: Create new branch on Example + run: | + git config user.name osuny-bot + git config user.email osuny@noesya.coop + echo "== Creating new branch ==" + git checkout -b theme--${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} + - name: Checkout submodule + uses: actions/checkout@v4 + with: + repository: noesya/osuny-hugo-theme-aaa + token: ${{ secrets.OSUNY_EXAMPLE_TOKEN }} + path: themes/osuny-hugo-theme-aaa + ref: ${{ github.head_ref || github.ref_name }} + - name: Pushing new branch on Example + run: | + 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 diff --git a/assets/js/vendors/carousel.js b/assets/js/vendors/carousel.js index eb86fbe6aa7f7d8b01292b355ffe465cdad0f369..41d1afa93a711b7adc3bb8a7c1f0b52d307d58ea 100644 --- a/assets/js/vendors/carousel.js +++ b/assets/js/vendors/carousel.js @@ -21,10 +21,8 @@ class Carousel { init () { this.splide = new Splide(this.element).mount(); - const toggleButton = this.splide.root.querySelector('.splide__autoplay'), - stepButtons = this.splide.root.querySelectorAll('.splide__pagination button'), - elements = this.splide.root.querySelectorAll('.splide__pagination, .splide__slide'), - autoplay = this.splide.Components.Autoplay; + const toggleButton = this.splide.root.querySelector('.splide__toggle'), + stepButtons = this.splide.root.querySelectorAll('.splide__pagination button'); this.listen(); @@ -33,28 +31,17 @@ class Carousel { stepButton.innerHTML = '<i></i>'; }); - this.splide.on('autoplay:play', () => { - toggleButton.classList.add('is-active'); - }); - this.splide.on('autoplay:playing', (rate) => { - var activeStepButton = this.splide.root.querySelector('.splide__pagination .is-active i'); + const activeStepButton = this.splide.root.querySelector('.splide__pagination .is-active i'); activeStepButton.style.width = rate * 100 + '%'; }); - this.splide.on('autoplay:pause', () => { - toggleButton.classList.remove('is-active'); - }); - - elements.forEach(element => { - element.addEventListener('click', () => { - autoplay.pause(); + stepButtons.forEach((stepButton) => { + const progressBar = stepButton.querySelector('i'); + stepButton.addEventListener('click', () => { + progressBar.style.removeProperty("width"); }) }); - - this.splide.on('drag', () => { - autoplay.pause(); - }); } } diff --git a/assets/sass/_theme/_configuration.sass b/assets/sass/_theme/_configuration.sass index 6753489e7a08a47465fb5e2bfee5c07c563cc961..5f6d13b4ea1aa0b90941ddd9fe2d2895d88742f9 100644 --- a/assets/sass/_theme/_configuration.sass +++ b/assets/sass/_theme/_configuration.sass @@ -9,7 +9,6 @@ $color-background: #FFFFFF !default $body-color: $color-text !default $body-background-color: $color-background !default $link-color: $color-text !default -$link-underline-offset: 0.2em !default // Grid $grid-gutter: px2rem(64) !default @@ -136,6 +135,12 @@ $quote-line-height: 120% !default $quote-weight: normal !default $quote-style: italic !default +// Link +$link-underline-offset: 0.2em !default +$link-underline-thickness: 1px !default +$link-transition: text-decoration-color .3s ease !default +$link-unhover-decoration-color-alpha: 0.3 !default + // Buttons $btn-font-size-desktop: px2rem(18) !default // TODO $btn-font-size: px2rem(14) !default @@ -147,6 +152,13 @@ $btn-border-radius: px2rem(4) !default $btn-border: 1px solid $color-text !default $btn-hover-background: $color-background-alt !default +// Chip +$chip-background: $color-background !default +$chip-background-hover: $color-background-alt !default +$chip-border: 1px solid $color-border !default +$chip-border-radius: $btn-border-radius !default +$chip-color: $color-text !default + // Form $form-btn-color: $color-background !default $form-btn-background-color: $color-accent !default @@ -371,6 +383,7 @@ $block-key_figures-number-font-size-xxl: px2rem(80) !default // Block gallery $block-gallery-carousel-background: $color-background-alt !default +$block-gallery-carousel-max-height: 70vh !default // Block image $block-image-max-height-with-sidebar: calc(100vh - var(--header-height)) !default diff --git a/assets/sass/_theme/_utils.sass b/assets/sass/_theme/_utils.sass index ceb093562fb0711a29d40fb542ce50081997ff76..0e9fd77345bf757f181cbf8f230ad8f80780306c 100644 --- a/assets/sass/_theme/_utils.sass +++ b/assets/sass/_theme/_utils.sass @@ -47,16 +47,16 @@ $space-unit: 4 !default @mixin link($color: $link-color, $unhover_decorated: true) color: $color text-decoration-line: underline - text-decoration-thickness: 1px + text-decoration-thickness: $link-underline-thickness text-underline-offset: $link-underline-offset - transition: text-decoration-color .3s ease + transition: $link-transition @if $unhover_decorated - text-decoration-color: rgba($color, 0.3) + text-decoration-color: rgba($color, $link-unhover-decoration-color-alpha) @else text-decoration-color: transparent &:hover text-decoration-color: rgba($color, 1) - text-decoration-thickness: 1px + text-decoration-thickness: $link-underline-thickness @mixin link-hovered-underline-only &:not(:hover) @@ -442,26 +442,29 @@ $space-unit: 4 !default font-display: swap src: $src -@mixin sidebar - @include in-page-with-sidebar - @include media-breakpoint-down(desktop) - padding: 0 half($grid-gutter-sm) - margin-bottom: $spacing3 - @include media-breakpoint-up(desktop) +@mixin sidebar($side: start) + @include media-breakpoint-down(desktop) + padding: 0 half($grid-gutter-sm) + margin-bottom: $spacing3 + @include media-breakpoint-up(desktop) + @if $side == start @include container-margin-left - margin-top: 0 - top: 0 left: 0 - height: 100% - position: absolute - width: col-outside-container(4) - &:not(.paper-sidebar)> div - @include sticky($spacing1) - .toc-container - border-top: 1px solid $color-border - padding-top: $spacing1 - position: static - margin-left: 0 + @else + @include container-margin-right + right: 0 + margin-top: 0 + top: 0 + height: 100% + position: absolute + width: col-outside-container(4) + & > div + @include sticky($spacing1) + .toc-container + border-top: 1px solid $color-border + padding-top: $spacing1 + position: static + margin-left: 0 // Old browsers support diff --git a/assets/sass/_theme/blocks/agenda.sass b/assets/sass/_theme/blocks/agenda.sass index b005c94765df87d05177c4827448100a2af82e0d..dd3ac8ce95f7daa433e8cb55d9ff3cd4e9523779 100644 --- a/assets/sass/_theme/blocks/agenda.sass +++ b/assets/sass/_theme/blocks/agenda.sass @@ -1 +1,8 @@ -// Styled in sections/events \ No newline at end of file +// Styled in sections/events + +.block-agenda + .top + a + @include icon(arrow-right, after, true) + @include hover-translate-icon + text-decoration: none \ No newline at end of file diff --git a/assets/sass/_theme/blocks/gallery.sass b/assets/sass/_theme/blocks/gallery.sass index 300a3bcb6fd5393e4a7dbe327c7dbd6c0855887b..609e87c3552240b2c451940e187cc179d2b39877 100644 --- a/assets/sass/_theme/blocks/gallery.sass +++ b/assets/sass/_theme/blocks/gallery.sass @@ -39,6 +39,8 @@ @include grid(2) grid-gap: half($grid-gutter-sm) !important &--with-text + @include in-page-without-sidebar + @include grid(4, desktop, $spacing0) figure display: grid grid-template-columns: subgrid @@ -46,7 +48,6 @@ figcaption &::after content: ' ' - &--carousel overflow: hidden position: relative @@ -96,12 +97,12 @@ picture img // FIXME Arnaud: I would like images at constant height, can't manage to get it right. - max-height: 70vh + max-height: $block-gallery-carousel-max-height width: auto height: auto max-width: calc(100vw - #{$grid-gutter-sm} * 2) @include media-breakpoint-up(desktop) - height: 70vh + height: $block-gallery-carousel-max-height width: auto max-width: none figcaption diff --git a/assets/sass/_theme/blocks/pages.sass b/assets/sass/_theme/blocks/pages.sass index 7cdba45f0e4edf09225559fb0927c163e1eced91..74ec85e673490317a52fe47b3521bfc13d7811db 100644 --- a/assets/sass/_theme/blocks/pages.sass +++ b/assets/sass/_theme/blocks/pages.sass @@ -2,7 +2,7 @@ .top a text-decoration: none - .grid, .cards + .grid, .cards, .list article position: relative display: flex @@ -128,66 +128,116 @@ &--list ul @include list-reset + &.title-only + li + line-height: 1 li display: block - line-height: 1 + li margin-top: $spacing0 - a + > a @include icon(arrow, before, true) padding-right: $spacing0 @include hover-translate-icon(before, 5) @include link text-decoration-color: rgba(0,0,0,0) - + article + .page-title + @include h3 + a + @include icon(arrow, after, true) + @include hover-translate-icon(after) + text-decoration-color: transparent @include media-breakpoint-down(desktop) .top margin-bottom: $spacing0 ul margin-top: $spacing1 - + @include media-breakpoint-up(desktop) + ul:not(.title-only) + li + li + margin-top: $grid-gutter + article + gap: $grid-gutter + flex-direction: row + .media + flex-shrink: 0 + margin-bottom: 0 @include in-page-with-sidebar .block-content .top margin-bottom: $spacing1 - ul + // .description + // margin-bottom: $spacing2 + ul.title-only @include grid(2, desktop) grid-row-gap: $spacing0 !important grid-column-gap: half($grid-gutter) !important li margin-top: 0 + a + @include meta + article + gap: half($grid-gutter) + .media + width: calc(#{col(2, 8)} + #{half($grid-gutter)}) + .page-content + width: col(6, 8) @include in-page-without-sidebar .block-title a @include stretched-link(before) - .block-content - @include grid - .top - align-items: initial - grid-column: 1 / 8 - margin-bottom: 0 - display: grid - grid-template-rows: subgrid - grid-row: span 2 - .block-title - width: auto - .description - @include body-text - margin-top: 0 - // Default behavior (without page description) - ul - @include grid(4, desktop) + .top + .description + p + @include h2 + article + .media + width: col(4) + .page-content + width: col(8) + &:not(.with-description) + ul.title-only + @include grid(4, desktop, space(2)) grid-column: 1 / 13 li margin-top: 0 - // If page description - .top + ul - grid-column: 9 / 13 - grid-row: 2 - display: block + ul:not(.title-only) + @include grid(2, desktop) li + li - margin-top: $spacing0 + margin-top: 0 + &.with-description + .block-content + @include grid(12, desktop, $spacing2) + row-gap: half($grid-gutter) + .top + align-items: initial + grid-column: 1 / 8 + margin-bottom: 0 + display: grid + grid-template-rows: subgrid + grid-row: span 2 + .block-title + width: auto + .description + @include body-text + margin-top: 0 + // If page description + .top + ul + grid-column: 9 / 13 + grid-row: 2 + display: block + li + li + margin-top: $spacing0 + article + margin-top: $spacing3 + &.with-images + .top + grid-column: 1 / 7 + .top + ul + grid-column: 7 / 13 + &--alternate .top diff --git a/assets/sass/_theme/blocks/testimonials.sass b/assets/sass/_theme/blocks/testimonials.sass index 10cbfcbc6726078df7467a9f4bfbf55fc10b784e..338da01140524b2eae8277d0e7fa6c5559f939cf 100644 --- a/assets/sass/_theme/blocks/testimonials.sass +++ b/assets/sass/_theme/blocks/testimonials.sass @@ -36,31 +36,29 @@ margin-right: calc(#{$grid-gutter} / 2) .splide - display: flex - flex-direction: column-reverse - &__autoplay - bottom: auto + .splide__slider + display: flex + flex-direction: column-reverse + &__toggle + border: 1px solid $block-testimonials-pagination-background + border-radius: 50% + cursor: pointer + font-size: 0 + height: 42px + padding: 0 + position: absolute + right: 0 top: 0 - button - @include button-reset - font-size: px2rem(14) - line-height: 1 - &::after - border: 1px solid $block-testimonials-pagination-background // TODO : variable - border-radius: 50% - content: "" - height: 42px - left: 50% - position: absolute - top: 50% - transform: translate(-50%, -50%) - width: 42px + width: 42px + font-size: 0 + line-height: 1 + span + color: $color-accent &::before - color: $color-accent - &:not(.is-active) - + .splide__pagination - .is-active i - width: 100% !important + font-size: 42px + .splide__pagination + .is-active i + width: 100% .splide__play &::before diff --git a/assets/sass/_theme/dependencies/splide.sass b/assets/sass/_theme/dependencies/splide.sass index 976f7a904617836a3d926c7702133e49802927a8..fce97da6a5c7e83d97a282e10b6a66caec7d5298 100644 --- a/assets/sass/_theme/dependencies/splide.sass +++ b/assets/sass/_theme/dependencies/splide.sass @@ -39,30 +39,11 @@ &.is-active &::before background-color: $link-color - - &__autoplay - bottom: 0 - position: absolute - right: 0 - &.is-active - .splide__play - display: none - .splide__pause - display: inline-block - - &__pause, - &__play - height: 48px - padding: 0 - width: 48px - - &__play - @include icon-block(play) - - &__pause - @include icon-block(pause) - display: none - + &__toggle + &__pause + @include icon-block(pause) + &__play + @include icon-block(play) &[data-slides-length="1"] .splide diff --git a/assets/sass/_theme/design-system/a11y.sass b/assets/sass/_theme/design-system/a11y.sass index 100667b58c6dd1d8126dfe59f8f59e59344c50a4..9fbce2042a73076d5f2a81bd005b4de4fb9546e5 100644 --- a/assets/sass/_theme/design-system/a11y.sass +++ b/assets/sass/_theme/design-system/a11y.sass @@ -1,7 +1,7 @@ .nav-accessibility padding: $spacing1 position: absolute - transform: translateY(calc(-100% - 24px)) + transform: translateY(-300%) z-index: $zindex-nav-accessibility a color: black diff --git a/assets/sass/_theme/design-system/nav.sass b/assets/sass/_theme/design-system/nav.sass index 85bf719d0937e6417bb6c2c6b00b88952c00d794..5abd9de7ead9e47a04770d020c990ea56bfbcf53 100644 --- a/assets/sass/_theme/design-system/nav.sass +++ b/assets/sass/_theme/design-system/nav.sass @@ -107,7 +107,8 @@ @if $header-dropdown-full .dropdown-menu &:not(.dropdown-languages) - inset: 100% 0 auto 0 + @include inset(100%, 0, auto, 0) + // inset: 100% 0 auto 0 padding-left: 0 padding-right: 0 padding-bottom: $spacing2 diff --git a/assets/sass/_theme/design-system/search.sass b/assets/sass/_theme/design-system/search.sass index 8560a31ddb04fba2f7ac6e64ab354528406a01bb..51de286019805b918136be9ec99e66659f48ac69 100644 --- a/assets/sass/_theme/design-system/search.sass +++ b/assets/sass/_theme/design-system/search.sass @@ -17,14 +17,14 @@ &:not(.toggle-text) @include icon(search-inline, after) &::after - line-height: inherit margin-left: half($spacing0) &:not(.pagefind-menu) padding: half($spacing0) $spacing0 &.toggle-icon::after font-size: $h3-size - @include media-breakpoint-up(desktop) - margin-top: px2rem(5) + &.toggle-both + .menu & span + padding-right: 0 span, &::after display: inline @@ -34,7 +34,7 @@ width: 100% @include media-breakpoint-up(desktop) &.toggle-icon::after - margin-left: 0 + margin-left: 0 .search__close @include icon-block(close, after) position: fixed @@ -173,7 +173,6 @@ .menu .nav-level-1 > li .pagefind-ui__toggle:not(.toggle-icon)::after margin-left: 0 - margin-top: px2rem(2) .pagefind-fixed align-items: center @@ -223,8 +222,6 @@ footer#document-footer .footer-search .nav-search display: flex - .pagefind-menu:not(.toggle-icon)::after - margin-top: 10px .menu .nav-level-1 > li .pagefind-ui__toggle span display: inline diff --git a/assets/sass/_theme/design-system/typography.sass b/assets/sass/_theme/design-system/typography.sass index bbd9a4bb0d1283f09fcee88e8ea0f8bb202f229b..b17ab94d5ff712e724ce143ec28460cbebc2f062 100644 --- a/assets/sass/_theme/design-system/typography.sass +++ b/assets/sass/_theme/design-system/typography.sass @@ -269,7 +269,19 @@ a, @include icon-block(link-blank-block, after) &:hover background: $btn-hover-background - + +.chip + @include meta + background: $chip-background + border: $chip-border + border-radius: $chip-border-radius + color: $chip-color + text-decoration: none + padding: space(1) space(4) + transition: background 0.3s + &:hover + background: $chip-background-hover + .link-more @include link @include icon(arrow, before) diff --git a/assets/sass/_theme/sections/events.sass b/assets/sass/_theme/sections/events.sass index 0f4a81236179a8010cd6666aa813da38a84ace84..c9031b2575d14e8486eeac12d061c7950c1e8168 100644 --- a/assets/sass/_theme/sections/events.sass +++ b/assets/sass/_theme/sections/events.sass @@ -6,12 +6,16 @@ .lead @include h3 // Safe spacing if post is empty - .document-content - min-height: 350px - &::after - content: '' - display: block - height: 1px + &:not(.full-width) + .event-sidebar + @include sidebar + @include media-breakpoint-up(desktop) + .document-content + min-height: 600px + &::after + content: '' + display: block + height: 1px .events__section .archive-link @@ -27,21 +31,18 @@ text-align: left .event-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 + padding-bottom: $spacing3 .event-date text-transform: capitalize ul @include list-reset > li padding-top: $spacing0 - padding-bottom: $spacing0 - padding: 1rem 0 - font-family: $body-font-family + &:not(:last-child) + padding-bottom: $spacing0 > span @include meta color: $color-text-alt @@ -52,11 +53,20 @@ @include icon(arrow) &::before padding-right: 0.3rem - a - @include link($color-accent) .events-categories display: flex gap: space(2) + a + @include link($color-accent) + .events-actions + align-items: start + display: flex + flex-direction: column + gap: space(1) + padding-bottom: 0 + a + &::after + display: none .share a color: inherit @@ -259,7 +269,3 @@ &:not(.event--with-image) width: col(5) margin-left: offset(4) - - -.event-sidebar - @include sidebar \ No newline at end of file diff --git a/assets/sass/_theme/sections/papers.sass b/assets/sass/_theme/sections/papers.sass index b03bb7d9be26067e28093fb21f9efbea58f8fafb..9cbed0822fb597044d65044c06b3127522c2a7bc 100644 --- a/assets/sass/_theme/sections/papers.sass +++ b/assets/sass/_theme/sections/papers.sass @@ -44,7 +44,6 @@ margin-top: $spacing2 @include media-breakpoint-up(desktop) margin-top: $spacing3 - .papers__page @include media-breakpoint-down(desktop) @@ -68,13 +67,10 @@ @include sticky(-1px) .media width: col(2, 4) - .document-content min-height: 100vh .content margin-bottom: $spacing4 - @include media-breakpoint-up(desktop) - padding-left: offset(4) section + section margin-top: $spacing2 @include media-breakpoint-up(desktop) @@ -107,10 +103,6 @@ @include stretched-link(before) text-decoration: none .document-nav - // @include media-breakpoint-up(desktop) - // grid-column: 1 / 5 - // img - // width: col(2, 4) dl margin: 0 dt @@ -124,6 +116,32 @@ flex-direction: column span order: 3 + &:not(.full-width) + .document-content + &.sidebar-on-start + .section-sidebar + @include sidebar(start) + @include media-breakpoint-up(desktop) + .container + .content + padding-left: offset(4) + &.sidebar-on-end + .section-sidebar + @include sidebar(end) + @include media-breakpoint-up(desktop) + .container + .content + padding-right: offset(4) + .blocks + .block + .block-content + padding-left: 0 + padding-right: offset(4) + .heading + h2 + padding-left: 0 + padding-right: offset(4) + .citations &:not(:first-child) margin-top: $spacing3 @@ -139,6 +157,3 @@ p @include meta margin-top: $spacing0 - -.paper-sidebar - @include sidebar \ No newline at end of file diff --git a/assets/sass/_theme/sections/posts.sass b/assets/sass/_theme/sections/posts.sass index d96436f61e65a1b3838e66486ee3795098120e94..f355c79af5cdb92d0fe489d8299a564425aee078 100644 --- a/assets/sass/_theme/sections/posts.sass +++ b/assets/sass/_theme/sections/posts.sass @@ -21,9 +21,6 @@ @include meta color: $color-text-alt -.post-sidebar - @include sidebar - .posts__section, .authors__term, .posts_categories__term, @@ -85,6 +82,9 @@ // Safe spacing if post is empty .document-content min-height: 350px + &:not(.full-width) + .post-sidebar + @include sidebar .post-categories @include list-reset diff --git a/config.yaml b/config.yaml index 388e96ad0e426df8e969eb4737479cc967fd3c20..15c4c6412c7a7ebacec16b4fa3d0c16c87d05347 100644 --- a/config.yaml +++ b/config.yaml @@ -45,6 +45,9 @@ params: pages: index: truncate_description: 200 # Set to 0 to disable truncate + papers: + sidebar: + direction: start persons: index: layout: grid # grid | list @@ -69,6 +72,22 @@ params: programs: related_posts: quantity: 4 + blocks: + gallery: + splide: + arrows: true + pagination: false + autoWidth: true + autoplay: false + testimonials: + splide: + arrows: false + autoplay: true + pauseOnHover: false + pauseOnFocus: true + type: loop + autoHeight: true + interval: 8000 image_sizes: design_system: lightbox: @@ -89,7 +108,7 @@ params: chapter: mobile: 350 tablet: 450 - desktop: 1280 + desktop: 800 features: mobile: 350 tablet: 400 @@ -107,6 +126,10 @@ params: tablet: 100 desktop: 255 pages: + list: + mobile: 400 + tablet: 800 + desktop: 300 large: mobile: 400 tablet: 800 @@ -189,8 +212,8 @@ params: desktop: 900 item: mobile: 350 - tablet: 400 - desktop: 900 + tablet: 990 + desktop: 600 papers: hero: mobile: 400 diff --git a/i18n/en.yml b/i18n/en.yml index 7ec1caf9815bc03ececf3c12831070f6a052a6b7..6fd7068d1bc737b29117fa46a7e05f8ef87a8fc7 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -151,9 +151,18 @@ diplomas: type: Type de diplôme events: archives: Previous events archive + add_to_calendar: + title: Add to calendar + ical: Download .ICS file + google: Google Calendar + office: Office 365 + outlook: Microsoft Outlook + yahoo: Yahoo! Calendar category: one: Category other: Categories + date: Date + hour: Time none: No event next: Next event next_aria: Next event “{{ .Title }}†@@ -162,6 +171,7 @@ events: from: day: From day hour: From hour + share: Partager sur to: day: To day hour: To hour diff --git a/i18n/fr.yml b/i18n/fr.yml index 7d06756e8240fc2c35d2aee99c56fbfba487c2bb..4b47c0b3a37658a4c8d50b18586a632b26360f62 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -153,6 +153,13 @@ diplomas: type: Type de diplôme events: archives: Accéder aux archives des événements passés + add_to_calendar: + title: Ajouter à mon agenda + ical: Télécharger un fichier .ICS + google: Google Calendar + office: Office 365 + outlook: Microsoft Outlook + yahoo: Yahoo! Calendar category: one: Catégorie other: Catégories @@ -166,6 +173,7 @@ events: from: day: Date de début hour: Heure de début + share: Partager sur to: day: Jour de fin hour: Heure de fin diff --git a/layouts/papers/single.html b/layouts/papers/single.html index 02f7122c3427569075d375e921e291928c001ccc..fee68043d44206fb7381c5334ae37546a1096389 100644 --- a/layouts/papers/single.html +++ b/layouts/papers/single.html @@ -1,7 +1,7 @@ {{ define "main" }} {{ partial "papers/hero.html" . }} -<div class="document-content" itemscope itemtype="https://schema.org/ScholarlyArticle"> +<div class="document-content sidebar-on-{{ site.Params.papers.sidebar.direction }}" itemscope itemtype="https://schema.org/ScholarlyArticle"> <meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}"> {{ partial "papers/sidebar.html" . }} diff --git a/layouts/partials/GetTruncateContent b/layouts/partials/GetTruncateContent index d1eaa91db824dbcba4b4eb5399b9f66871531558..ab6ddc1081302ae2c5e29f45ca434816abff9b60 100644 --- a/layouts/partials/GetTruncateContent +++ b/layouts/partials/GetTruncateContent @@ -1,5 +1,9 @@ {{ $length := .length | default 150 }} +{{ $text := .text }} -{{ $text := replace .text "<" " <" }} -{{ $text = chomp (truncate $length "…" (safeHTML (plainify $text))) }} -{{ return $text }} +{{ if gt .length 0 }} + {{ $text = replace .text "<" " <" }} + {{ $text = chomp (truncate $length "…" (safeHTML (plainify $text))) }} +{{ end }} + +{{ return (partial "PrepareText" $text) }} \ No newline at end of file diff --git a/layouts/partials/blocks/templates/agenda.html b/layouts/partials/blocks/templates/agenda.html index d82332429b036cdd3efc91e761663a494978ed24..c6184883ea5e192c02c7175bbe32757882424523 100644 --- a/layouts/partials/blocks/templates/agenda.html +++ b/layouts/partials/blocks/templates/agenda.html @@ -1,36 +1,49 @@ {{- $block := .block }} {{- $block_class := partial "GetBlockClass" .block -}} - {{- with .block.data -}} {{- $show_summary := .show_summary -}} {{- $show_category := .show_category -}} {{- $show_status := .show_status -}} {{- $layout := .layout | default "list" -}} - + <div class="{{ $block_class }}"> <div class="container"> <div class="block-content"> + {{ $events_page := site.GetPage "/events" }} + {{ $link := $events_page.Permalink }} + + {{ if .category }} + {{ $term := site.GetPage (printf "/events_categories%s" .category) }} + {{ $link = $term.Permalink }} + {{ end }} + {{ partial "blocks/top.html" (dict "title" $block.title "heading_level" $block.ranks.self "description" .description + "link" $link )}} - <div class="events events--{{- $layout -}}"> - {{ range .events }} - {{ $event := site.GetPage .file }} - {{ with $event }} - {{ partial "events/event" (dict - "event" . - "layout" $layout - "show_summary" $show_summary - "show_category" $show_category - "show_status" $show_status - "heading" (printf "h%d" $block.ranks.children) - ) }} + {{ if .events }} + <div class="events events--{{- $layout -}}"> + {{ range .events }} + {{ $event := site.GetPage .file }} + {{ with $event }} + {{ partial "events/event" (dict + "event" . + "layout" $layout + "show_summary" $show_summary + "show_category" $show_category + "show_status" $show_status + "heading" (printf "h%d" $block.ranks.children) + ) }} + {{ end }} {{ end }} - {{ end }} - </div> + </div> + {{ else if .no_event_message }} + <p>{{ partial "PrepareHTML" .no_event_message }}</p> + {{ end }} + </div> </div> </div> diff --git a/layouts/partials/blocks/templates/gallery/carousel.html b/layouts/partials/blocks/templates/gallery/carousel.html index c14cea65d8aa346850f66aebd9ff6280d3c1514a..de6811bc510f8a9f02ba011f742855b85bb497ca 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='{"arrows":true,"pagination":false,"autoWidth":true,"autoplay":false}'> +<div class="splide" role="group" data-splide="{{ site.Params.blocks.gallery.splide | encoding.Jsonify }}"> <div class="splide__track"> <div class="splide__list"> {{ end -}} diff --git a/layouts/partials/blocks/templates/pages.html b/layouts/partials/blocks/templates/pages.html index 6fe502b7387969b6ec2f15b9420da0f2b5aece8d..64394a082c26a6abd62fc1415e37fdb721eeb2ce 100644 --- a/layouts/partials/blocks/templates/pages.html +++ b/layouts/partials/blocks/templates/pages.html @@ -4,8 +4,6 @@ {{- $layout := .block.data.layout | default "grid" -}} {{- with .block.data -}} - - {{- $show_main_page := false -}} {{- $show_main_description := .show_main_description -}} {{- $show_descriptions := .show_descriptions -}} {{- $show_images := .show_images -}} @@ -19,7 +17,6 @@ {{ end }} {{- with $page }} - {{- $show_main_page = true -}} {{- $page_link = $page.Permalink }} {{ if eq $title "" }} {{ $title = .Title }} @@ -28,17 +25,22 @@ {{- $page_class = printf "block-page-%s" .Params.bodyclass }} {{ end }} {{ if $show_main_description }} - {{ if site.Params.pages.index.truncate_description }} - {{- $main_description = partial "GetTruncateContent" ( dict - "text" .Params.summary - "length" site.Params.pages.index.truncate_description - ) -}} - {{ else }} - {{- $main_description = partial "PrepareText" .Params.summary -}} - {{ end }} + {{- $main_description = partial "GetTruncateContent" ( dict + "text" .Params.summary + "length" site.Params.pages.index.truncate_description + ) -}} {{ end }} {{ end -}} + {{ if $main_description }} + {{/* SHOULD BE FIXED WITH ORTHOTYPO */}} + {{ $main_description = printf "<p>%s</p>" $main_description }} + {{ $block_class = printf "%s %s" $block_class "with-description" }} + {{ end }} + {{ if $show_images }} + {{ $block_class = printf "%s %s" $block_class "with-images" }} + {{ end }} + <div class="{{ $block_class }} {{ $page_class }}"> <div class="container"> <div class="block-content"> @@ -46,8 +48,8 @@ "title" $title "link" $page_link "heading_level" $block.ranks.self - "description" (printf "<p>%s</p>" $main_description) - )}} + "description" $main_description + ) }} {{- partial (printf "blocks/templates/pages/%s.html" $layout) (dict "pages" .pages diff --git a/layouts/partials/blocks/templates/pages/alternate.html b/layouts/partials/blocks/templates/pages/alternate.html index 9b145d88ba3213421844c21a697f9157ffaf608e..90ceabd14e7f0460c2833332f891d7e72d9a1258 100644 --- a/layouts/partials/blocks/templates/pages/alternate.html +++ b/layouts/partials/blocks/templates/pages/alternate.html @@ -24,14 +24,10 @@ {{ $heading_tag.close }} {{ if and $show_descriptions .Params.summary }} - {{ if site.Params.pages.index.truncate_description }} - <p>{{ partial "GetTruncateContent" ( dict - "text" .Params.summary - "length" site.Params.pages.index.truncate_description - ) }}</p> - {{ else }} - <p>{{ partial "PrepareText" .Params.summary }}</p> - {{ end }} + <p>{{ partial "GetTruncateContent" ( dict + "text" .Params.summary + "length" site.Params.pages.index.truncate_description + ) }}</p> {{ end }} {{ if $show_images }} diff --git a/layouts/partials/blocks/templates/pages/cards.html b/layouts/partials/blocks/templates/pages/cards.html index 125e566d1e8fa9452f83a76efd585c50900f4fb9..5689e6e3ecb5a822a976f78e5d949a9baba58be2 100644 --- a/layouts/partials/blocks/templates/pages/cards.html +++ b/layouts/partials/blocks/templates/pages/cards.html @@ -17,14 +17,10 @@ {{ $heading_tag.close }} {{ if and $show_descriptions .Params.summary }} - {{ if site.Params.pages.index.truncate_description }} - <p>{{ partial "GetTruncateContent" ( dict - "text" .Params.summary - "length" site.Params.pages.index.truncate_description - ) }}</p> - {{ else }} - <p>{{ partial "PrepareText" .Params.summary }}</p> - {{ end }} + <p>{{ partial "GetTruncateContent" ( dict + "text" .Params.summary + "length" site.Params.pages.index.truncate_description + ) }}</p> {{ end }} <p class="more meta" aria-hidden="true">{{- i18n "commons.more" -}}</p> diff --git a/layouts/partials/blocks/templates/pages/grid.html b/layouts/partials/blocks/templates/pages/grid.html index 67a4af74dbbd9eaeaaf5c6b5c5bafd8018df2d43..68b8aa8c9674c743dbc80480504bf56b87c0bf35 100644 --- a/layouts/partials/blocks/templates/pages/grid.html +++ b/layouts/partials/blocks/templates/pages/grid.html @@ -26,14 +26,10 @@ {{ $heading_tag.close }} {{ if and $show_descriptions .Params.summary }} - {{ if site.Params.pages.index.truncate_description }} - <p>{{ partial "GetTruncateContent" ( dict - "text" .Params.summary - "length" site.Params.pages.index.truncate_description - ) }}</p> - {{ else }} - <p>{{ partial "PrepareText" .Params.summary }}</p> - {{ end }} + <p>{{ partial "GetTruncateContent" ( dict + "text" .Params.summary + "length" site.Params.pages.index.truncate_description + ) }}</p> {{ end }} {{ if $show_images }} {{- partial "pages/page-media.html" . -}} diff --git a/layouts/partials/blocks/templates/pages/large.html b/layouts/partials/blocks/templates/pages/large.html index 112a8bacc5fa8d84260512f1364b205747c4da08..890680f8857ac8ee798b57d33c8a448de9e7dd48 100644 --- a/layouts/partials/blocks/templates/pages/large.html +++ b/layouts/partials/blocks/templates/pages/large.html @@ -18,14 +18,10 @@ {{ $heading_tag.close }} {{ if and $show_descriptions .Params.summary }} - {{ if site.Params.pages.index.truncate_description }} - <p>{{ partial "GetTruncateContent" ( dict - "text" .Params.summary - "length" site.Params.pages.index.truncate_description - ) }}</p> - {{ else }} - <p>{{ partial "PrepareText" .Params.summary }}</p> - {{ end }} + <p>{{ partial "GetTruncateContent" ( dict + "text" .Params.summary + "length" site.Params.pages.index.truncate_description + ) }}</p> {{ end }} <p class="more meta" aria-hidden="true">{{- i18n "commons.more" -}}</p> </div> diff --git a/layouts/partials/blocks/templates/pages/list.html b/layouts/partials/blocks/templates/pages/list.html index 0a7945ac4540a8ef4c4da1973b2769eeb1a40dc5..879d74d67904c9ebb5b2b26a0a39b6c8b2d5f0d5 100644 --- a/layouts/partials/blocks/templates/pages/list.html +++ b/layouts/partials/blocks/templates/pages/list.html @@ -1,11 +1,51 @@ -<ul> +{{ $show_descriptions := .show_descriptions }} +{{ $show_images := .show_images }} +{{ $heading_level := .heading_level | default 3 }} +{{ $heading_tag := partial "GetHeadingTag" (dict + "level" $heading_level + "attributes" "class='page-title'" +)}} +<ul class="list {{ if and (not $show_descriptions) (not $show_images) }} title-only {{ end }}"> {{ range .pages }} {{ $page := site.GetPage .file }} {{ with $page }} <li> - <a href="{{- .Permalink -}}"> - {{- partial "PrepareHTML" .Title -}} - </a> + {{ if or $show_descriptions $show_images }} + <article> + <div class="page-content"> + {{ $heading_tag.open }} + <a href="{{- .Permalink -}}"> + {{- partial "PrepareHTML" .Title -}} + </a> + {{ $heading_tag.close }} + + {{ if and $show_descriptions .Params.summary }} + <p>{{ partial "GetTruncateContent" ( dict + "text" .Params.summary + "length" site.Params.pages.index.truncate_description + ) }}</p> + {{ end }} + </div> + + {{ if $show_images }} + <div class="media"> + {{- if .Params.image -}} + {{- partial "commons/image.html" + (dict + "image" .Params.image + "sizes" site.Params.image_sizes.blocks.pages.list + ) -}} + {{- else -}} + {{- partial "commons/image-default.html" -}} + {{- end -}} + </div> + {{ end }} + </article> + {{ else }} + <a href="{{- .Permalink -}}"> + {{- partial "PrepareHTML" .Title -}} + </a> + {{ end }} </li> {{- end -}} {{ end }} diff --git a/layouts/partials/blocks/templates/posts.html b/layouts/partials/blocks/templates/posts.html index cf5e9a3dbf6cd49fc58151f7506f5e90e1f0b965..c8b0fb9ccfc21e61e700635115669998059c1b46 100644 --- a/layouts/partials/blocks/templates/posts.html +++ b/layouts/partials/blocks/templates/posts.html @@ -30,8 +30,8 @@ <ul class="categories categories--grid"> {{ range site.Taxonomies.posts_categories }} <li data-title="{{ .Page.Title }}"> - <a href="{{ .Permalink }}" class="title" aria-label="{{ i18n "commons.more_aria" (dict "Title" .Title) }}">{{ partial "PrepareHTML" .Title }}</a> - <p>{{ i18n "blocks.categories.items.count" (dict "Count" (len .)) }}</p> + <a href="{{ .Page.Permalink }}" class="title" aria-label="{{ i18n "commons.more_aria" (dict "Title" .Page.Title) }}">{{ partial "PrepareHTML" .Page.Title }}</a> + <p>{{ i18n "blocks.categories.items.count" ( len . ) }}</p> </li> {{ end }} </ul> diff --git a/layouts/partials/blocks/templates/posts/highlight.html b/layouts/partials/blocks/templates/posts/highlight.html index cadbf215fe9ee2ce01cf13cf717a7fad30292d9c..ee6b189ed7612f824693239de569c59ff50f96e4 100644 --- a/layouts/partials/blocks/templates/posts/highlight.html +++ b/layouts/partials/blocks/templates/posts/highlight.html @@ -34,14 +34,10 @@ {{ end }} {{ if site.Params.posts.index.show_description }} {{- if (partial "GetTextFromHTML" .Params.summary) -}} - {{ if site.Params.posts.index.truncate_description }} - <p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict - "text" .Params.summary - "length" site.Params.posts.index.truncate_description - ) }}</p> - {{ else }} - <p itemprop="articleBody">{{ partial "PrepareText" .Params.summary }}</p> - {{ end }} + <p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict + "text" .Params.summary + "length" site.Params.posts.index.truncate_description + ) }}</p> {{- end -}} {{- end -}} diff --git a/layouts/partials/blocks/templates/posts/large.html b/layouts/partials/blocks/templates/posts/large.html index 3dbe90b492e11335fc5635c176ab1ef25380d1d1..77eda21448264a4d3d8ba881047f8f9362f962bd 100644 --- a/layouts/partials/blocks/templates/posts/large.html +++ b/layouts/partials/blocks/templates/posts/large.html @@ -36,14 +36,10 @@ {{ if site.Params.posts.index.show_description }} {{- if (partial "GetTextFromHTML" .Params.summary) -}} - {{ if site.Params.posts.index.truncate_description }} - <p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict - "text" .Params.summary - "length" site.Params.posts.index.truncate_description - ) }}</p> - {{ else }} - <p itemprop="articleBody">{{ partial "PrepareText" .Params.summary }}</p> - {{ end }} + <p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict + "text" .Params.summary + "length" site.Params.posts.index.truncate_description + ) }}</p> {{- end -}} {{- end -}} <p class="more meta" aria-hidden="true">{{- i18n "commons.more" -}}</p> diff --git a/layouts/partials/blocks/templates/testimonials.html b/layouts/partials/blocks/templates/testimonials.html index a7da6ead4763537382c606315f5ee3acf13a87f3..37d373454aadc7612944318543abbff430906f94 100644 --- a/layouts/partials/blocks/templates/testimonials.html +++ b/layouts/partials/blocks/templates/testimonials.html @@ -20,16 +20,7 @@ <div class="testimonials"> {{- if $is_carousel }} <div class="splide" - data-splide='{ - "arrows":false, - "autoplay":true, - "pauseOnHover":false, - "pauseOnFocus":true, - "type":"loop", - "autoHeight":true, - "interval":8000 - }' - > + data-splide="{{ site.Params.blocks.testimonials.splide | encoding.Jsonify }}"> <div class="splide__slider"> <div class="splide__track"> <div class="splide__list"> @@ -73,10 +64,10 @@ </div> </div> - <div class="splide__autoplay is-active"> - <button class="splide__play"></button> - <button class="splide__pause"></button> - </div> + <button class="splide__toggle"> + <span class="splide__toggle__play"></span> + <span class="splide__toggle__pause"></span> + </button> </div> {{ end -}} diff --git a/layouts/partials/events/event-infos.html b/layouts/partials/events/event-infos.html index 9ad84dd1acffcf8234dc7efec4fc9ad27c609f3c..0846822fde6bc513674a10b1a1fec6101f8513b7 100644 --- a/layouts/partials/events/event-infos.html +++ b/layouts/partials/events/event-infos.html @@ -21,12 +21,37 @@ {{ end }} {{ if .Params.events_categories }} <li> - <span>{{ i18n "events.category" (dict "Count" ( len .Params.events_categories )) }}</span> + <span>{{ i18n "events.category" ( len .Params.events_categories ) }}</span> {{ partial "events/categories.html" . }} </li> {{ end }} <li> - <span>{{ i18n "posts.share" }}</span> + <span>{{ i18n "events.share" }}</span> {{ partial "commons/share.html" . }} </li> + + {{ if not .Params.dates.archive }} + {{ with .Params.dates.add_to_calendar }} + {{ $links := . }} + <li class="events-actions"> + <span>{{ i18n "events.add_to_calendar.title" }}</span> + {{- $types := slice "ical" "google" "office" "outlook" "yahoo" -}} + {{- range $type := $types -}} + {{ $label := i18n (printf "events.add_to_calendar.%s" $type) }} + {{ with index $links $type }} + <a class="chip" + {{ if eq $type "ical" -}} + {{ printf `href="%s"` . | safeHTMLAttr }} download + {{ else }} + href="{{ . }}" + target="_blank" + {{ end }} > + {{- $label -}} + </a> + {{- end }} + {{- end }} + </li> + {{- end }} + {{- end }} + </ul> diff --git a/layouts/partials/events/event.html b/layouts/partials/events/event.html index 57eb5a97a5d212aa8a1ca7919f1331dd6fa7a6f9..461f866dbe3c28fdbed6882f3c150fd49b02e9c6 100644 --- a/layouts/partials/events/event.html +++ b/layouts/partials/events/event.html @@ -57,14 +57,10 @@ {{- if (partial "GetTextFromHTML" .Params.summary) -}} <div class="event-description"> <p itemprop="description"> - {{ if site.Params.events.index.truncate_description }} - {{ partial "GetTruncateContent" ( dict - "text" .Params.summary - "length" site.Params.events.index.truncate_description - ) }} - {{ else }} - {{ partial "PrepareText" .Params.summary }} - {{ end }} + {{ partial "GetTruncateContent" ( dict + "text" .Params.summary + "length" site.Params.events.index.truncate_description + ) }} </p> </div> {{- end -}} diff --git a/layouts/partials/footer/debug.html b/layouts/partials/footer/debug.html index d1f611236aa91542caa561fc524ed9c9dbedbff0..fb2fa584fa76cbd6ef6d3f389a1d8cf826751aa5 100644 --- a/layouts/partials/footer/debug.html +++ b/layouts/partials/footer/debug.html @@ -145,6 +145,36 @@ } } + .img-debug { + font-size: 1.1rem; + line-height: 1.2; + padding: 10px; + background-color: white; + color: black; + display: block; + position: absolute; + bottom: 0; + left: 0; + font-family: sans-serif; + white-space: nowrap; + opacity: 0.9; + } + + .img-debug small { + font-size: 0.9rem; + font-family: sans-serif; + display: none; + } + + .img-debug:hover small { + display: block; + } + + .img-debug.is-bad { + background: tomato; + color: black; + } + </style> <script> @@ -157,6 +187,9 @@ if (e.ctrlKey && e.key === 'w') { document.body.classList.toggle('full-width'); } + if (e.ctrlKey && e.key === 'i') { + showImageDimension(); + } }); window.addEventListener('pointermove', e => { @@ -174,23 +207,61 @@ }) }) - function responsiveImageDebugOutput(img) { - if (!img) { - throw new TypeError("Expected an image node. Got none."); - } - const listener = function () { - const pixelRatio = window.devicePixelRatio > 1 ? 2 : 1; - const dimensionWidth = img.naturalWidth * pixelRatio; - const dimensionHeight = img.naturalHeight * pixelRatio; - console.log(` - ------------------------- - Rendered size: ${img.width}x${img.height} - Intrinsic size: ${dimensionWidth}x${dimensionHeight} - Device Pixel Ratio: ${window.devicePixelRatio} - ------------------------- - `); - }; - if (img.complete) listener(); - //img.addEventListener('load', listener); + function showImageDimension() { + document.querySelectorAll('img').forEach(img => { + const listener = function () { + // Return if svg + if (img.src.split('.')[1] === 'svg') return; + + const threshold = 0.2, // 20% of tolerance + parent = img.parentElement, + pixelRatio = window.devicePixelRatio, + dimensions = { + width: img.naturalWidth * pixelRatio, + height: img.naturalHeight * pixelRatio + }, + target = { + width: img.width * window.devicePixelRatio, + height: img.height * window.devicePixelRatio + }, + essential = +`<b>Loaded</b> : ${dimensions.width}x${dimensions.height}\n +<b>Needed</b> : ${target.width}x${target.height}`, + result =` + Rendered size: ${img.width}x${img.height} + Intrinsic size: ${dimensions.width}x${dimensions.height} + Device Pixel ratio: ${window.devicePixelRatio}`, + p = parent.querySelector('.img-debug') || document.createElement('p'), + small = document.createElement('small'); + + small.innerText = result; + p.innerHTML = essential + p.append(small); + p.classList.add('img-debug'); + const ratio = getImageRatio(dimensions, target) + if (ratio > threshold) { + p.classList.add('is-bad'); + } else { + p.classList.remove('is-bad'); + } + + const debug = img.querySelector('.img-debug'); + if (debug) parent.removeChild(); + + parent.append(p); + parent.style.position = 'relative'; + }; + + if (img.complete) listener(); + img.addEventListener('load', listener); + window.addEventListener('resize', listener); + }); + } + + function getImageRatio(source, target) { + const widthRatio = Math.abs((source.width - target.width) / Math.max(source.width, target.width)), + heightRatio = Math.abs((source.height - target.height) / Math.max(source.height, target.height)); + + return (widthRatio + heightRatio) / 2; } </script> \ No newline at end of file diff --git a/layouts/partials/footer/social.html b/layouts/partials/footer/social.html index 1d0d7ac883d66a491be15a4dfc0a8099d480e5a7..f53b805d9bd36b7b62781d1a9418db11bf9be0ef 100644 --- a/layouts/partials/footer/social.html +++ b/layouts/partials/footer/social.html @@ -9,8 +9,8 @@ )}} {{ end }} -{{ with site.Data.website.social }} - {{ $site_social_links := index . }} +{{ with (or site.Params.social site.Data.website.social) }} + {{ $site_social_links := . }} {{ if $site_social_links }} <ul class="footer-social site-links"> {{ with $site_social_links.email}} @@ -35,7 +35,7 @@ {{ end}} {{ with $site_social_links.github}} <li class="github"> - <a href="{{ . }}" rel="noreferrer" title="Github" target="_blank">Github</a> + <a href="{{ . }}" rel="noreferrer" title="Github" target="_blank">GitHub</a> </li> {{ end}} {{ with $site_social_links.linkedin}} diff --git a/layouts/partials/header/header.html b/layouts/partials/header/header.html index f0ab7dce143b4e88d003861bd9cff212c7f9dda6..e92304f4d532c12b906a5fa44033786d0a8945f5 100644 --- a/layouts/partials/header/header.html +++ b/layouts/partials/header/header.html @@ -1,18 +1,21 @@ -{{ $context := . }} +{{ $primary := partial "GetMenu" "primary" }} + <header id="document-header"> <nav aria-label="{{ i18n "commons.menu.main" }}"> <div class="container"> {{ partial "header/logo.html" }} - {{ partial "header/button.html" }} - <div class="menu" id="navigation"> - {{ partial "commons/menu.html" - (dict - "kind" "primary" - "dropdown" true - "level" 1 - "context" . - ) }} - </div> + {{ if $primary.items }} + {{ partial "header/button.html" }} + <div class="menu" id="navigation"> + {{ partial "commons/menu.html" + (dict + "kind" "primary" + "dropdown" true + "level" 1 + "context" . + ) }} + </div> + {{ end }} </div> </nav> </header> diff --git a/layouts/partials/posts/post-infos.html b/layouts/partials/posts/post-infos.html index 6ecc0e9a425d9982866833df510b26d3e4686e82..47b8b35b98b5c55acfc3ebe15977dfb9ff8b5ed6 100644 --- a/layouts/partials/posts/post-infos.html +++ b/layouts/partials/posts/post-infos.html @@ -1,7 +1,7 @@ <ul class="post-infos"> {{ if .Params.posts_categories }} <li> - <span>{{ i18n "posts.categories" ( len .Params.posts_categories ) }}</span> + <span>{{ i18n "posts.category" ( len .Params.posts_categories ) }}</span> {{ partial "posts/categories.html" . }} </li> {{ end }} diff --git a/layouts/partials/posts/post.html b/layouts/partials/posts/post.html index 352d7d88eb15c254bb7a26967e8df482b0dfd0b9..f987a41e7235edb60180e26a1700f57204e59ce1 100644 --- a/layouts/partials/posts/post.html +++ b/layouts/partials/posts/post.html @@ -28,14 +28,10 @@ {{ if site.Params.posts.index.show_description }} {{- if (partial "GetTextFromHTML" .Params.summary) -}} - {{ if site.Params.posts.index.truncate_description }} - <p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict - "text" .Params.summary - "length" site.Params.posts.index.truncate_description - ) }}</p> - {{ else }} - <p itemprop="articleBody">{{ partial "PrepareText" .Params.summary }}</p> - {{ end }} + <p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict + "text" .Params.summary + "length" site.Params.posts.index.truncate_description + ) }}</p> {{- end -}} {{- end -}} diff --git a/package.json b/package.json index 6c892cbfbe8b29b3e16d0ce15b2138384e31ba85..ef04083d591914f2234d23809ac4e854b63bd36c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ ], "license": "MIT", "dependencies": { - "@splidejs/splide": "^3", + "@splidejs/splide": "^4", "cssnano": "^5", "cssnano-preset-advanced": "^6.0.1", "glightbox": "^3", diff --git a/static/osuny-theme-version b/static/osuny-theme-version index 5dc0480cd3d02d191a6fc69ed2ea8578fa0bdce1..b91cebaa0bc2ae2eff0a46fa7ebd4944e1b065f1 100644 --- a/static/osuny-theme-version +++ b/static/osuny-theme-version @@ -1 +1 @@ -v5.1.7 \ No newline at end of file +v5.2 \ No newline at end of file