diff --git a/.github/workflows/gitlab.yml b/.github/workflows/gitlab.yml new file mode 100644 index 0000000000000000000000000000000000000000..aac739274eb8946eee49f8568f7b290a0564a5db --- /dev/null +++ b/.github/workflows/gitlab.yml @@ -0,0 +1,19 @@ +name: GitlabSync + +on: + - push + - delete + +jobs: + sync: + runs-on: ubuntu-latest + name: Git Repo Sync + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: wangchucheng/git-repo-sync@v0.1.0 + with: + target-url: ${{ secrets.GITLAB_TARGET_URL }} + target-username: ${{ secrets.GITLAB_TARGET_USERNAME }} + target-token: ${{ secrets.GITLAB_TARGET_TOKEN }} \ No newline at end of file diff --git a/assets/js/theme/design-system/modal.js b/assets/js/theme/design-system/modal.js index 054006bb9a54bdddf6ae0c7f58d80c0d167f2d45..53d6f67cc38553e0351a6064d4bb40701f927270 100644 --- a/assets/js/theme/design-system/modal.js +++ b/assets/js/theme/design-system/modal.js @@ -29,15 +29,16 @@ class Modal { this.closeButtons.forEach(button => { button.addEventListener('click', () => { this.toggle(false); + this.button.focus() }); }); window.addEventListener('keydown', (event) => { if (event.keyCode === 27 || event.key === 'Escape') { this.toggle(false); - } else if (event.key === "Tab") { - // TODO fix a11y inner focus - // this.innerFocus(event); + } else if (event.key === "Tab" && this.state.isOpened) { + this.innerFocus(event); + event.preventDefault(); } }); @@ -66,8 +67,7 @@ class Modal { else if (!this.element.contains(event.target)) { firstFocusable.focus(); } - - this.closeButtons[0].focus(); + firstFocusable.focus(); } toggle(open = !this.state.isOpened) { @@ -76,10 +76,6 @@ class Modal { this.element.setAttribute('aria-hidden', !this.state.isOpened); document.documentElement.classList[classAction](CLASSES.modalOpened); - - if (!this.state.isOpened) { - this.button.focus(); - } } } diff --git a/assets/sass/_theme/_configuration.sass b/assets/sass/_theme/_configuration.sass index 774ff0f9aa4a65b774c0fe35d1ab7155ef636a97..1336740cc03e30fe29512ab44f13db92d9bcb832 100644 --- a/assets/sass/_theme/_configuration.sass +++ b/assets/sass/_theme/_configuration.sass @@ -80,6 +80,12 @@ $lead-sidebar-size-desktop: px2rem(32) !default $lead-sidebar-line-height: $lead-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-weight: $lead-sidebar-weight !default + // Body $body-size-desktop: px2rem(22) !default $body-size: px2rem(18) !default diff --git a/assets/sass/_theme/blocks/posts.sass b/assets/sass/_theme/blocks/posts.sass index e527760ed302e636fb03f68023b90c3dd54ae7c7..8f11f51669448a5ad55036d3dbb54ab9323b9de7 100644 --- a/assets/sass/_theme/blocks/posts.sass +++ b/assets/sass/_theme/blocks/posts.sass @@ -166,3 +166,33 @@ margin-top: 0 article:first-child margin-top: 0 + &--alternate .alternate + @include media-breakpoint-up(desktop) + .post + width: col(3,8) + &.right + margin-left: auto + &.portrait + + .portrait + margin-top: -30% + + .square, + + .landscape + margin-top: -15% + + .post:not(.portrait, .square, .landscape) + margin-top: -5% + @include in-page-without-sidebar + width: col(10) + margin-left: auto + margin-right: auto + .post + width: col(4, 10) + @include media-breakpoint-down(desktop) + .post + .post-meta + margin-top: half($spacing0) + .media + margin-bottom: $spacing0 + + .post + margin-top: $spacing3 + .post .media img + aspect-ratio: unset \ No newline at end of file diff --git a/assets/sass/_theme/dependencies/glightbox.sass b/assets/sass/_theme/dependencies/glightbox.sass index 421fd968cda67d8ed31163212599c67e381ebabe..33f8f044bfc288f5f1e2b92d099da374699c1c2f 100644 --- a/assets/sass/_theme/dependencies/glightbox.sass +++ b/assets/sass/_theme/dependencies/glightbox.sass @@ -19,6 +19,8 @@ .gdesc-inner padding-left: 0 padding-right: 0 +a.glightbox + display: block // @media (min-width: 769px) // .goverlay diff --git a/assets/sass/_theme/design-system/header.sass b/assets/sass/_theme/design-system/header.sass index 44a354c2ca8c5ad60e1f309fa6068b4f0bd4a904..67a35ae766bbc985d0c54ee3774c46a766c9478c 100644 --- a/assets/sass/_theme/design-system/header.sass +++ b/assets/sass/_theme/design-system/header.sass @@ -36,6 +36,7 @@ header#document-header &:not(:hover) transform: translateY(-100%) .logo + color: $header-color img display: block height: $header-logo-height diff --git a/assets/sass/_theme/design-system/hero.sass b/assets/sass/_theme/design-system/hero.sass index 28833f74a895687e32394e82c660311c4b10ce8f..318ae6e90e77d69a2e31fe13a062a436d5aa099c 100644 --- a/assets/sass/_theme/design-system/hero.sass +++ b/assets/sass/_theme/design-system/hero.sass @@ -21,6 +21,8 @@ h1 + p margin-top: $spacing1 + .lead + @include lead-hero figure position: relative &, img, picture diff --git a/assets/sass/_theme/design-system/typography.sass b/assets/sass/_theme/design-system/typography.sass index 74f77bde3c05013af766aa575abf7c31f33a0a56..82b06aafe0d1b7d7a2844b4cb825a058101a0a0b 100644 --- a/assets/sass/_theme/design-system/typography.sass +++ b/assets/sass/_theme/design-system/typography.sass @@ -118,6 +118,15 @@ h2, .h2 .lead @include lead +@mixin lead-hero + font-family: $lead-hero-font-family + font-size: $lead-hero-size + font-weight: $lead-hero-weight + line-height: $lead-hero-line-height + @include media-breakpoint-up(desktop) + font-size: $lead-hero-size-desktop + + @mixin body-text font-family: $body-font-family font-size: $body-size @@ -270,7 +279,7 @@ sup margin-left: px2rem(2) *:focus-visible - outline-color: gray + outline-color: inherit outline-offset: 5px outline-style: dashed outline-width: 1px diff --git a/assets/sass/_theme/sections/diplomas.sass b/assets/sass/_theme/sections/diplomas.sass index 45cddaa3979ee283544df60b9184f0d9db053eed..67b54c24234bc8aa2bbce2dfe42e097f5550707a 100644 --- a/assets/sass/_theme/sections/diplomas.sass +++ b/assets/sass/_theme/sections/diplomas.sass @@ -114,23 +114,29 @@ ul.diplomas .essential-container .container + @include media-breakpoint-down(sm) + .buttons > * + width: col(8) @include media-breakpoint-down(md) .buttons display: flex gap: $spacing1 flex-wrap: wrap + > * + min-width: 150px + width: col(7) @include media-breakpoint-up(md) @include grid(2, md) align-items: flex-end .buttons + align-items: end display: flex - justify-content: flex-end flex-direction: column - align-items: end gap: $spacing1 + justify-content: flex-end > * - width: col(2, 6) min-width: 200px + width: col(2, 6) .essential color: $header-color diff --git a/assets/sass/_theme/sections/papers.sass b/assets/sass/_theme/sections/papers.sass index 81ec014cfb51ba0e2e4b865cfc44c7b4389ce1aa..961afc26435fadba62a3307463860b29f454d71c 100644 --- a/assets/sass/_theme/sections/papers.sass +++ b/assets/sass/_theme/sections/papers.sass @@ -52,12 +52,12 @@ aside order: 2 padding: 0 half($grid-gutter-sm) + margin-bottom: $spacing3 @include media-breakpoint-up(desktop) .hero .content > h1, > hgroup width: auto - .paper-sidebar @include container-margin-left margin-top: 0 @@ -66,17 +66,22 @@ height: 100% position: absolute width: col-outside-container(4) - // > div - // @include sticky($spacing1) + > div + height: 100% + position: relative + aside + border-bottom: 1px solid $color-border + padding-bottom: $spacing1 .toc-container - border-top: 1px solid $color-border - padding-top: $spacing1 - position: static + height: unset margin-left: 0 + padding-top: $spacing1 + @include sticky(-1px) .media width: col(2, 4) .document-content + min-height: 100vh .content margin-bottom: $spacing4 @include media-breakpoint-up(desktop) diff --git a/assets/sass/_theme/sections/programs.sass b/assets/sass/_theme/sections/programs.sass index 076fa264a174891e236ea66c3c96d7c6f4b4bb11..beb3f19f30f8913230a089a0eace4d9fc8dfea5a 100644 --- a/assets/sass/_theme/sections/programs.sass +++ b/assets/sass/_theme/sections/programs.sass @@ -22,12 +22,13 @@ ol.programs .container position: relative &:not(.full-width) - .lead - font-family: $lead-font-family - font-weight: $lead-weight - line-height: $lead-line-height - @include media-breakpoint-up(desktop) - font-size: $lead-size-desktop + .document-content + .lead + font-family: $lead-font-family + font-weight: $lead-weight + line-height: $lead-line-height + @include media-breakpoint-up(desktop) + font-size: $lead-size-desktop ol.programs margin-bottom: $spacing3 @@ -88,7 +89,6 @@ ol.programs background: $hero-color border-color: $hero-color font-size: $program-share-font-size - width: auto @include media-breakpoint-up(desktop) font-size: $program-share-font-size-desktop diff --git a/config.yaml b/config.yaml index 41c2fbb984c1793e9b3ce1ef19d13d5a96773f4a..f8730c57a51063e9fe70ebe80eea675c25607473 100644 --- a/config.yaml +++ b/config.yaml @@ -4,16 +4,22 @@ params: enable: false blank: true page: https://gdpr.eu/cookies/ + plausible: false + seo: + title: + separator: "|" + logo: + header: "/assets/images/logo.svg" + footer: "/assets/images/logo.svg" breadcrumb: - position: hero-start # hero-start | hero-end | after-hero - plausible: - posts: - default_image: false - index: - show_categories: false - show_author: false - truncate_description: 200 # Set to 0 to disable truncate - layout: list # grid | list + position: hero-start # hero-start | hero-end | after-hero | none + summary: + position: content # content | hero + home: + toc: + disabled: true + organizations: + dark_logo_background: false pages: index: truncate_description: 200 # Set to 0 to disable truncate @@ -22,20 +28,22 @@ params: persons: index: layout: list # grid | list + posts: + default_image: false + date_format: ":date_long" + index: + show_categories: false + show_author: false + show_description: true + truncate_description: 200 # Set to 0 to disable truncate + layout: list # grid | list programs: related_posts: quantity: 4 - home: - toc: - disabled: true - logo: - header: "/assets/images/logo.svg" - footer: "/assets/images/logo.svg" - organizations: - dark_logo_background: false image_sizes: design_system: lightbox: + disabled: false # TODO mobile et tablet mobile: 1920x2560 tablet: 1920x2560 @@ -70,6 +78,8 @@ params: tablet: 216 desktop: 196 testimonials: + mobile: 80 + tablet: 160 desktop: 200 gallery: carousel: @@ -131,10 +141,6 @@ params: mobile: 400 tablet: 800 desktop: 900 - hero_single: - mobile: 400 - tablet: 800 - desktop: 900 persons: hero: mobile: 400 diff --git a/content/error.html b/content/error.html new file mode 100644 index 0000000000000000000000000000000000000000..75d3b1a5cccfa89f9ceacb7a5b17f4387bc93bec --- /dev/null +++ b/content/error.html @@ -0,0 +1,5 @@ +--- +title: 404 +url: error.html +layout: 404 +--- \ No newline at end of file diff --git a/i18n/en.yml b/i18n/en.yml index f2b298f34238880752baaf38bc7a5126997fec85..be31ab2038a06503f9f118fcd5ddcfc08fb91ce3 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -101,6 +101,7 @@ commons: between: pages: Pages navigation posts: Posts navigation + title: Page pdf: PDF pdf_with_size: PDF ({{ .Size }}) read: Read @@ -156,6 +157,11 @@ papers: accepted: Accepted received: Received download: Download + toc: + abstract: Abstract + researchers: Authors + references: References + content: Content persons: posts: News programs: Programs diff --git a/i18n/fr.yml b/i18n/fr.yml index a2e5e2d74fb0eab09f3ec407c3e674472833fd98..37dc88ea9e13a6b6061642c1014fc848c1199c79 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -101,6 +101,7 @@ commons: between: pages: Navigation entre pages posts: Navigation entre articles + title: Page pdf: PDF pdf_with_size: PDF ({{ .Size }}) read: Lire @@ -156,6 +157,11 @@ papers: accepted: Date d'acceptation received: Date de réception download: Téléchargement + toc: + abstract: Abstract + researchers: Auteurs + references: Références + content: Texte intégral persons: posts: Actualités publiées récemment programs: Enseignements diff --git a/layouts/diplomas/term.html b/layouts/diplomas/term.html index 807600e004d965ff28e56ef214cb0b84a2e45e2f..0190e79eeab6914c52967daf4e63a497d50255f9 100644 --- a/layouts/diplomas/term.html +++ b/layouts/diplomas/term.html @@ -2,6 +2,11 @@ {{ partial "diplomas/hero-single.html" . }} <div class="document-content"> + + {{ partial "posts/summary.html" (dict + "context" . + "block_wrapped" true + ) }} {{ partial "blocks/list.html" . }} <div class="container"> <ol class="programs"> diff --git a/layouts/papers/list.html b/layouts/papers/list.html index cf1842505e5f7807726303e5c1892677f06f44a8..cad287b8e5bf48e2eb1823ef18adee35e922e5e2 100644 --- a/layouts/papers/list.html +++ b/layouts/papers/list.html @@ -1,12 +1,6 @@ {{ define "main" }} - {{- $title := or .Params.header_text .Title -}} - {{- partial "header/hero.html" - (dict - "title" $title - "image" .Params.image - "sizes" site.Params.image_sizes.sections.papers.hero - "context" . - ) -}} +{{ partial "papers/hero.html" . }} + <div class="document-content"> <div class="container"> <ul class="papers"> diff --git a/layouts/papers/single.html b/layouts/papers/single.html index f03da63b98e732d1cde266b92e354fc6b9ebcde3..946db8ac1c84c34946c475ee7850779a436bad0d 100644 --- a/layouts/papers/single.html +++ b/layouts/papers/single.html @@ -1,19 +1,13 @@ {{ define "main" }} - {{- $title := or .Params.header_text .Title -}} - {{- partial "header/hero.html" - (dict - "title" $title - "subtitle" .Params.summary - "image" .Params.image - "sizes" site.Params.image_sizes.sections.papers.hero_single - "context" . - ) -}} +{{ partial "papers/hero.html" . }} + <div class="document-content" itemscope itemtype="https://schema.org/ScholarlyArticle"> <meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}"> {{ partial "papers/sidebar.html" . }} <div class="container"> <div class="content"> + {{ partial "papers/summary.html" . }} {{ partial "papers/abstract.html" . }} {{ partial "papers/authors.html" . }} {{ partial "papers/body.html" . }} diff --git a/layouts/partials/GetPaginateTitle b/layouts/partials/GetPaginateTitle new file mode 100644 index 0000000000000000000000000000000000000000..abcc7c46b668c438479cde93c50975611734d203 --- /dev/null +++ b/layouts/partials/GetPaginateTitle @@ -0,0 +1,14 @@ +{{ $seoTitle := .title }} +{{ $seoTitleSeparator := .separator}} +{{ $page := i18n "commons.pagination.title" }} + +{{if not .context.IsHome }} + {{ with .context.Paginator }} + {{ if or .HasPrev .HasNext }} + {{ $currentPageNumber := .PageNumber}} + {{ $seoTitle = printf "%s %s %s %d" $seoTitle $seoTitleSeparator $page $currentPageNumber }} + {{ end }} + {{ end }} +{{ end }} + +{{ return $seoTitle }} \ No newline at end of file diff --git a/layouts/partials/blocks/templates/chapter.html b/layouts/partials/blocks/templates/chapter.html index 9e4fdf1202b7af01f273d854d1b631cf67439ded..ada8be2036d8b1ace492824b8cc2fe84fdbfb9de 100644 --- a/layouts/partials/blocks/templates/chapter.html +++ b/layouts/partials/blocks/templates/chapter.html @@ -39,9 +39,11 @@ {{ if .image }} <figure class="{{- $image_class -}}"> <a class="glightbox" + role="button" data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" href="{{- partial "GetLightboxUrl" .image -}}" title="{{- i18n "commons.lightbox.link.title" -}}" + aria-label="{{- i18n "commons.lightbox.link.title" -}}" > {{ partial "commons/image.html" (dict diff --git a/layouts/partials/blocks/templates/gallery/carousel.html b/layouts/partials/blocks/templates/gallery/carousel.html index a787ab3f2ef92ef36950e507f2c1c6b44f7bb5b9..d343948fd45e851f67ff5da99225fa2c42d0f069 100644 --- a/layouts/partials/blocks/templates/gallery/carousel.html +++ b/layouts/partials/blocks/templates/gallery/carousel.html @@ -14,18 +14,23 @@ {{- $image := partial "GetMedia" .file -}} {{- if $image -}} <figure{{ if $is_carousel }} class="splide__slide"{{ end }}> - <a class="glightbox" - data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" - href="{{ partial "GetLightboxUrl" (dict "id" .id) }}" - title="{{- i18n "commons.lightbox.link.title" -}}" - > - {{ partial "commons/image.html" - (dict - "image" .id - "alt" .alt - "sizes" site.Params.image_sizes.blocks.gallery.carousel - )}} - </a> + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + <a class="glightbox" + role="button" + data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ 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 }} <figcaption> {{ if .text }} diff --git a/layouts/partials/blocks/templates/gallery/grid.html b/layouts/partials/blocks/templates/gallery/grid.html index fe5a4a1cc4da6785a27e3580bbce659156c2c5f2..eea4aa67cbe41ae145f70c44fef17858b89f2dd3 100644 --- a/layouts/partials/blocks/templates/gallery/grid.html +++ b/layouts/partials/blocks/templates/gallery/grid.html @@ -4,18 +4,23 @@ {{- $image := partial "GetMedia" .id -}} {{- if $image -}} <figure> - <a class="glightbox" - data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" - href="{{ partial "GetLightboxUrl" (dict "id" .id) }}" - title="{{- i18n "commons.lightbox.link.title" -}}" - > + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + <a class="glightbox" + role="button" + data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ 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" .file "alt" .alt "sizes" site.Params.image_sizes.blocks.gallery.grid )}} - </a> + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + </a> + {{ end }} {{ if .text }} <figcaption> {{- partial "PrepareHTML" .text -}} diff --git a/layouts/partials/blocks/templates/image.html b/layouts/partials/blocks/templates/image.html index 2bc4ef561c90b319677aa6348178501b123eeada..7b89b73fcc752d59afbb3492c3d6ae164b27b48f 100644 --- a/layouts/partials/blocks/templates/image.html +++ b/layouts/partials/blocks/templates/image.html @@ -21,18 +21,23 @@ {{- with .image -}} <figure class="{{ $image_class }}"> - <a class="glightbox" - data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" - href="{{- partial "GetLightboxUrl" . -}}" - title="{{- i18n "commons.lightbox.link.title" -}}" - > - {{ partial "commons/image.html" - (dict - "image" . - "alt" .alt - "sizes" site.Params.image_sizes.blocks.image - )}} - </a> + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + <a class="glightbox" + role="button" + data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" + href="{{- partial "GetLightboxUrl" . -}}" + title="{{- i18n "commons.lightbox.link.title" -}}" + aria-label="{{- i18n "commons.lightbox.link.title" -}}"> + {{ end }} + {{ partial "commons/image.html" + (dict + "image" . + "alt" .alt + "sizes" site.Params.image_sizes.blocks.image + )}} + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + </a> + {{ end }} <figcaption> {{- if $text }} {{ partial "PrepareHTML" $text }} diff --git a/layouts/partials/blocks/templates/posts/alternate.html b/layouts/partials/blocks/templates/posts/alternate.html new file mode 100644 index 0000000000000000000000000000000000000000..2173bfba1d3bf85b2105783cbeb49f6539f75b20 --- /dev/null +++ b/layouts/partials/blocks/templates/posts/alternate.html @@ -0,0 +1,12 @@ +<div class="alternate"> + {{ range $i, $post := .posts -}} + {{ with site.GetPage (printf "/posts/%s" $post) }} + {{ partial "posts/post.html" (dict + "post" . + "heading" "h3" + "index" $i + "alternate" true + ) }} + {{ end }} + {{ end }} +</div> \ No newline at end of file diff --git a/layouts/partials/blocks/templates/posts/highlight.html b/layouts/partials/blocks/templates/posts/highlight.html index 9a2cc62ff41f977a36dbe0f6bdf29ea54b1adf27..f7f857bba321da834051c97eb5e6d669eaa79bcc 100644 --- a/layouts/partials/blocks/templates/posts/highlight.html +++ b/layouts/partials/blocks/templates/posts/highlight.html @@ -24,19 +24,21 @@ {{ if site.Params.posts.index.show_categories }} {{- partial "posts/categories" . -}} {{ end }} - {{- 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 }} + {{ 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 }} + {{- end -}} {{- end -}} <div class="post-meta"> - <time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format ":date_long" }}</time> + <time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format site.Params.posts.date_format }}</time> {{ if site.Params.posts.index.show_author }} {{- partial "posts/author" . -}} {{ end }} diff --git a/layouts/partials/categories/summary.html b/layouts/partials/categories/summary.html index 4ed5a570f5d60bc07d29393efb221e5fa06a7b8b..85e4edf81a14c7fedc7c790f755b91710a4d9224 100644 --- a/layouts/partials/categories/summary.html +++ b/layouts/partials/categories/summary.html @@ -1 +1 @@ -{{- partial "commons/summary.html" . -}} +{{- partial "commons/summary-in-content.html" . -}} diff --git a/layouts/partials/commons/summary.html b/layouts/partials/commons/summary-in-content.html similarity index 60% rename from layouts/partials/commons/summary.html rename to layouts/partials/commons/summary-in-content.html index ba373dae0ab485522d315405e034689c36c3c5c1..91d2c27f140500b5e2cf71a49bac284da3f413cf 100644 --- a/layouts/partials/commons/summary.html +++ b/layouts/partials/commons/summary-in-content.html @@ -1,7 +1,5 @@ -{{- $text := (partial "GetTextFromHTML" .context.Params.summary) -}} - -{{- if $text -}} - +{{ $summary := .summary | default (partial "PrepareText" .context.Params.summary) }} +{{- if and (eq site.Params.summary.position "content") $summary -}} {{- if .block_wrapped -}} <section class="block block-summary"> <div class="container"> @@ -10,9 +8,7 @@ <div class="container"> {{- end -}} - <p class="lead" role="heading" aria-level="2"> - {{ partial "PrepareText" .context.Params.summary }} - </p> + <p class="lead" role="heading" aria-level="2">{{ $summary }}</p> {{- if .block_wrapped -}} </div> diff --git a/layouts/partials/diplomas/hero-single.html b/layouts/partials/diplomas/hero-single.html index 6bd1f4316602337264941abc45c0d527d90bb5aa..cb95352560d4d4bc659781a8a9f6fa951d0c8419 100644 --- a/layouts/partials/diplomas/hero-single.html +++ b/layouts/partials/diplomas/hero-single.html @@ -1,11 +1,24 @@ {{- $title := or .Params.header_text .Title -}} +{{ $subtitle := "" }} +{{- $summary := partial "PrepareText" .Params.summary -}} +{{ if and (eq site.Params.summary.position "hero") $summary }} + {{ $subtitle = $summary }} +{{ end }} + <header class="hero"> <div class="container"> {{- if .Params.breadcrumb | default true -}} {{ partial "header/breadcrumbs.html" . }} {{- end -}} <div class="content"> - <h1>{{ partial "PrepareHTML" $title }}</h1> + {{- 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 }} <figure> {{ partial "commons/image.html" diff --git a/layouts/partials/diplomas/summary.html b/layouts/partials/diplomas/summary.html index 4ed5a570f5d60bc07d29393efb221e5fa06a7b8b..85e4edf81a14c7fedc7c790f755b91710a4d9224 100644 --- a/layouts/partials/diplomas/summary.html +++ b/layouts/partials/diplomas/summary.html @@ -1 +1 @@ -{{- partial "commons/summary.html" . -}} +{{- partial "commons/summary-in-content.html" . -}} diff --git a/layouts/partials/footer/debug.html b/layouts/partials/footer/debug.html index bb2359ce3f2b72ccb554ac33362ed622f1486996..b6863c633e6e46b16b0e9a836549f972a8c6d79f 100644 --- a/layouts/partials/footer/debug.html +++ b/layouts/partials/footer/debug.html @@ -17,7 +17,7 @@ <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>3 (50px) </span></div> <div><span>4 (128px) </span></div> <div><span>5 (256px) </span></div> </div> @@ -25,8 +25,8 @@ <div class="d-cross"></div> <style> :root { - --d-grid-margin: 64px; - --d-grid-sm-margin: 44px; + --d-grid-margin: 50px; + --d-grid-sm-margin: 30px; } .d-grid { bottom: 0; diff --git a/layouts/partials/head/seo.html b/layouts/partials/head/seo.html index 93ad3f2eb3ea8913e27db9c6a28168623771e057..138b9262b0a8b33c16b2ee9aba35fe63c002192e 100644 --- a/layouts/partials/head/seo.html +++ b/layouts/partials/head/seo.html @@ -1,7 +1,10 @@ +{{- $title := chomp (htmlUnescape .Title) -}} {{- $seoTitle := htmlUnescape site.Title -}} +{{- $seoTitleSeparator := htmlUnescape site.Params.seo.title.separator -}} {{- if .Title -}} - {{- $seoTitle = printf "%s | %s" (chomp (htmlUnescape .Title)) $seoTitle -}} + {{- $seoTitle = printf "%s %s %s" $title $seoTitleSeparator $seoTitle -}} {{- end -}} +{{- $seoTitle = partial "GetPaginateTitle" ( dict "title" $seoTitle "separator" $seoTitleSeparator "context" .) -}} {{- $seoDescription := "" -}} {{- if .Params.meta_description -}} {{- $seoDescription = partial "PrepareHTML" .Params.meta_description -}} diff --git a/layouts/partials/header/hero.html b/layouts/partials/header/hero.html index b01e30716032d106215437e43c63cd7b2052b795..d3c557c9e4868841836d6133966462ead8d3c026 100644 --- a/layouts/partials/header/hero.html +++ b/layouts/partials/header/hero.html @@ -1,9 +1,20 @@ {{- $direction := "" -}} {{- $breadcrumb_is_after_hero := eq site.Params.breadcrumb.position "after-hero" -}} +{{- $subtitle := .subtitle -}} {{ if .image }} {{- $direction = partial "GetImageDirection" .image -}} {{ end }} +{{- $summary := partial "PrepareText" .context.Params.summary -}} +{{- $subtitle_is_summary := false -}} + +{{ if not $subtitle }} + {{ if and (eq site.Params.summary.position "hero") $summary }} + {{ $subtitle = $summary }} + {{ $subtitle_is_summary = true }} + {{ end }} +{{ end }} + <header class="hero {{ if .image -}}hero--with-image hero--image-{{- $direction -}}{{- end }} {{ if $breadcrumb_is_after_hero -}} hero--no-margin {{- end }}"> <div class="container"> {{- if eq site.Params.breadcrumb.position "hero-start" -}} @@ -12,28 +23,33 @@ {{- end -}} {{- end -}} <div class="content"> - {{- if .subtitle -}} + {{- if $subtitle -}} <hgroup> <h1>{{ partial "PrepareHTML" .title }}</h1> - <p>{{ partial "PrepareHTML" .subtitle }}</p> + <p {{ if $subtitle_is_summary -}} class="lead" {{- end -}}>{{ partial "PrepareHTML" $subtitle }}</p> </hgroup> {{- else -}} <h1>{{ partial "PrepareHTML" .title }}</h1> {{- end -}} {{- if .image }} <figure> - <a class="glightbox" - data-glightbox="type: image;{{ if .image.credit }}description: {{ partial "PrepareHTML" .image.credit }}{{ end }}" - href="{{ partial "GetLightboxUrl" .image }}" - title="{{- i18n "commons.lightbox.link.title" -}}" - > + {{ 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 }}" + 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 }} </a> + {{ end }} {{ if partial "GetTextFromHTML" .image.credit }} <figcaption tabindex="0"> <p> diff --git a/layouts/partials/home/summary.html b/layouts/partials/home/summary.html index 4ed5a570f5d60bc07d29393efb221e5fa06a7b8b..85e4edf81a14c7fedc7c790f755b91710a4d9224 100644 --- a/layouts/partials/home/summary.html +++ b/layouts/partials/home/summary.html @@ -1 +1 @@ -{{- partial "commons/summary.html" . -}} +{{- partial "commons/summary-in-content.html" . -}} diff --git a/layouts/partials/organizations/summary.html b/layouts/partials/organizations/summary.html index 4ed5a570f5d60bc07d29393efb221e5fa06a7b8b..85e4edf81a14c7fedc7c790f755b91710a4d9224 100644 --- a/layouts/partials/organizations/summary.html +++ b/layouts/partials/organizations/summary.html @@ -1 +1 @@ -{{- partial "commons/summary.html" . -}} +{{- partial "commons/summary-in-content.html" . -}} diff --git a/layouts/partials/pages/summary.html b/layouts/partials/pages/summary.html index 4ed5a570f5d60bc07d29393efb221e5fa06a7b8b..85e4edf81a14c7fedc7c790f755b91710a4d9224 100644 --- a/layouts/partials/pages/summary.html +++ b/layouts/partials/pages/summary.html @@ -1 +1 @@ -{{- partial "commons/summary.html" . -}} +{{- partial "commons/summary-in-content.html" . -}} diff --git a/layouts/partials/papers/abstract.html b/layouts/partials/papers/abstract.html index b5259b11433fff82d58d9911c5c00d7f6ab67db0..a4b7bb1392fe06689b18f6d18c2fd43b43dd88be 100644 --- a/layouts/partials/papers/abstract.html +++ b/layouts/partials/papers/abstract.html @@ -1,13 +1,15 @@ -<section class="paper-essentials"> +<section class="paper-essentials" id="abstract"> {{ with .Params.Abstract }} <h2>{{ i18n "papers.abstract" }}</h2> <p itemprop="abstract">{{ partial "PrepareHTML" . }}</p> {{ end }} - <h2>{{ i18n "papers.download" }}</h2> - <div role="group"> - {{ partial "papers/actions.html" (dict - "paper" . - "only_file" true - ) }} - </div> + {{ if .Params.Pdf }} + <h2>{{ i18n "papers.download" }}</h2> + <div role="group"> + {{ partial "papers/actions.html" (dict + "paper" . + "only_file" true + ) }} + </div> + {{ end }} </section> diff --git a/layouts/partials/papers/authors.html b/layouts/partials/papers/authors.html index 95763e57e20f3ccd5159d67f914d3012661dc0b6..69df57a6b9dd12966c4988f407d129bcae453efc 100644 --- a/layouts/partials/papers/authors.html +++ b/layouts/partials/papers/authors.html @@ -1,5 +1,5 @@ {{ if .Params.Researchers }} - <section class="paper-authors"> + <section class="paper-authors" id="authors"> <h2>{{ i18n "volumes.authors" }}</h2> <div class="authors"> {{ range .Params.Researchers }} diff --git a/layouts/partials/papers/hero.html b/layouts/partials/papers/hero.html new file mode 100644 index 0000000000000000000000000000000000000000..a338c1a5c897c466a86141bce9bf9b84ed8019ba --- /dev/null +++ b/layouts/partials/papers/hero.html @@ -0,0 +1,8 @@ +{{- $title := or .Params.header_text .Title -}} +{{- partial "header/hero.html" + (dict + "title" $title + "image" .Params.image + "sizes" site.Params.image_sizes.sections.papers.hero + "context" . + ) -}} \ No newline at end of file diff --git a/layouts/partials/papers/references.html b/layouts/partials/papers/references.html index 8f9e163214da4adfc695ccb701c3d94aaa037c29..704a76b153e6a2f0dc387317c05569240d6a2b92 100644 --- a/layouts/partials/papers/references.html +++ b/layouts/partials/papers/references.html @@ -1,5 +1,5 @@ {{ with .Params.references }} - <section> + <section id="references"> <h2>{{ i18n "volumes.references" }}</h2> {{ partial "PrepareHTML" . }} </section> diff --git a/layouts/partials/papers/sidebar.html b/layouts/partials/papers/sidebar.html index 8dfd8b50d58bdf78909ba0ea8e74534eaf80c79b..d9bc295697b4f75ccc7c4d7d3c3e509321371995 100644 --- a/layouts/partials/papers/sidebar.html +++ b/layouts/partials/papers/sidebar.html @@ -64,6 +64,12 @@ {{ end }} </dl> </aside> + {{ partial "toc/container.html" + (dict + "toc" "papers/toc.html" + "context" . + ) + }} </div> </div> diff --git a/layouts/partials/papers/summary.html b/layouts/partials/papers/summary.html new file mode 100644 index 0000000000000000000000000000000000000000..45c401a2ced34930b5498a17b9ea91189e5c5e78 --- /dev/null +++ b/layouts/partials/papers/summary.html @@ -0,0 +1,6 @@ +{{ $summary := (partial "PrepareText" .Params.summary) }} +{{- if and (eq site.Params.summary.position "content") $summary -}} +<section> + <h2 class="lead">{{ $summary }}</h2> +</section> +{{ end }} \ No newline at end of file diff --git a/layouts/partials/papers/toc.html b/layouts/partials/papers/toc.html new file mode 100644 index 0000000000000000000000000000000000000000..33a92bce1ffa09da788b90750d828f9aa3473955 --- /dev/null +++ b/layouts/partials/papers/toc.html @@ -0,0 +1,26 @@ +{{ $content := .context.Content }} +{{ $references := .context.Params.References }} +{{ $researchers := .context.Params.researchers }} +{{ $abstract := .context.Params.Abstract }} +{{ $blocks := .context.Params.blocks}} + +<nav class="toc" id="nav-toc" aria-label="{{ i18n "commons.toc" }}"> + <ol> + {{- if $abstract -}} + <li><a href="#abstract">{{ i18n "papers.toc.abstract" }}</a></li> + {{- end -}} + {{- if $researchers -}} + <li><a href="#authors">{{ i18n "papers.toc.researchers" }}</a></li> + {{- end -}} + {{- if $content -}} + <li><a href="#full-text">{{ i18n "papers.toc.content" }}</a></li> + {{- end -}} + {{- if $references -}} + <li><a href="#references">{{ i18n "papers.toc.references" }}</a></li> + {{- end -}} + {{- if $blocks -}} + {{- partial "blocks/toc.html" $blocks -}} + {{- end -}} + </ol> + </nav> + \ No newline at end of file diff --git a/layouts/partials/persons/hero-single.html b/layouts/partials/persons/hero-single.html index 37e4352768ca477695b29b538623fe1ef2058ffa..09386e776bdad38e84b2fbd95b87ab061abec497 100644 --- a/layouts/partials/persons/hero-single.html +++ b/layouts/partials/persons/hero-single.html @@ -1,10 +1,24 @@ +{{ $subtitle := "" }} +{{- $summary := partial "PrepareText" .Params.summary -}} +{{ if and (eq site.Params.summary.position "hero") $summary }} + {{ $subtitle = $summary }} +{{ end }} + <header class="hero"> <div class="container"> {{- if eq site.Params.breadcrumb.position "hero-start" -}} {{ partial "header/breadcrumbs.html" . }} {{- end -}} <div class="content"> - <h1>{{ safeHTML (partial "CorrectPunctuation" .Title) }}</h1> + {{- 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" diff --git a/layouts/partials/persons/summary.html b/layouts/partials/persons/summary.html index 4ed5a570f5d60bc07d29393efb221e5fa06a7b8b..85e4edf81a14c7fedc7c790f755b91710a4d9224 100644 --- a/layouts/partials/persons/summary.html +++ b/layouts/partials/persons/summary.html @@ -1 +1 @@ -{{- partial "commons/summary.html" . -}} +{{- partial "commons/summary-in-content.html" . -}} diff --git a/layouts/partials/posts/post-infos.html b/layouts/partials/posts/post-infos.html index 4c576b7dbcc8d881656b8f58f5be71309115e204..c47936dda1e6d5fd3d4b50a888675cfde4f3d05c 100644 --- a/layouts/partials/posts/post-infos.html +++ b/layouts/partials/posts/post-infos.html @@ -13,7 +13,7 @@ {{ end }} <li> <span>{{ i18n "posts.date" }}</span> - <time datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format ":date_long" }}</time> + <time datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format site.Params.posts.date_format }}</time> </li> {{ range .GetTerms "authors" }} <li> diff --git a/layouts/partials/posts/post.html b/layouts/partials/posts/post.html index df3fbd9a69246688e9ee3edf6383dfe4fcf6205d..3c4fbf0f442aa26658578ed1e8696c710401ed10 100644 --- a/layouts/partials/posts/post.html +++ b/layouts/partials/posts/post.html @@ -1,12 +1,20 @@ {{ $post := .post }} +{{- $direction := "" -}} {{ $heading := .heading | default "h2" }} {{ $heading_tag := (dict "open" ((printf "<%s itemprop='headline'>" $heading) | safeHTML) "close" ((printf "</%s>" $heading) | safeHTML) ) }} +{{ $index := .index}} +{{ $alternate := .alternate}} {{ with $post }} -<article class="post" itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting"> + +{{ if .Params.image }} + {{- $direction = partial "GetImageDirection" .Params.image -}} +{{ end }} + +<article class='post {{ if $alternate }}{{ $direction }} {{if not (modBool $index 2)}}left{{ else}}right{{end}}{{end}}' itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting"> <div class="post-content"> {{- $title := partial "PrepareHTML" .Title -}} @@ -18,19 +26,21 @@ {{- partial "posts/categories" . -}} {{ end }} - {{- 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 }} + {{ 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 }} + {{- end -}} {{- end -}} <div class="post-meta"> - <time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format ":date_long" }}</time> + <time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format site.Params.posts.date_format }}</time> {{ if site.Params.posts.index.show_author }} {{- partial "posts/author" . -}} {{ end }} diff --git a/layouts/partials/posts/summary.html b/layouts/partials/posts/summary.html index 4ed5a570f5d60bc07d29393efb221e5fa06a7b8b..85e4edf81a14c7fedc7c790f755b91710a4d9224 100644 --- a/layouts/partials/posts/summary.html +++ b/layouts/partials/posts/summary.html @@ -1 +1 @@ -{{- partial "commons/summary.html" . -}} +{{- partial "commons/summary-in-content.html" . -}} diff --git a/layouts/partials/programs/hero-single.html b/layouts/partials/programs/hero-single.html index c0ed3bb3fe702bf986dfc4dd1128b68c2be3cf0a..52958fc94d73abcd24857764f14bcb4c1edaa93b 100644 --- a/layouts/partials/programs/hero-single.html +++ b/layouts/partials/programs/hero-single.html @@ -1,11 +1,23 @@ {{- $title := or .Params.header_text .Title -}} +{{ $subtitle := "" }} +{{- $summary := partial "PrepareText" .Params.summary -}} +{{ if and (eq site.Params.summary.position "hero") $summary }} + {{ $subtitle = $summary }} +{{ end }} <header class="hero hero-program"> <div class="container"> {{- if .Params.breadcrumb | default true -}} {{ partial "header/breadcrumbs.html" . }} {{- end -}} <div class="content"> - <h1>{{ partial "PrepareHTML" $title }}</h1> + {{- if $subtitle -}} + <hgroup> + <h1>{{ partial "PrepareHTML" $title }}</h1> + <p class="lead">{{ partial "PrepareHTML" $subtitle }}</p> + </hgroup> + {{- else -}} + <h1>{{ partial "PrepareHTML" $title }}</h1> + {{- end -}} </div> </div> diff --git a/layouts/partials/programs/summary.html b/layouts/partials/programs/summary.html index 4ed5a570f5d60bc07d29393efb221e5fa06a7b8b..85e4edf81a14c7fedc7c790f755b91710a4d9224 100644 --- a/layouts/partials/programs/summary.html +++ b/layouts/partials/programs/summary.html @@ -1 +1 @@ -{{- partial "commons/summary.html" . -}} +{{- partial "commons/summary-in-content.html" . -}} diff --git a/layouts/partials/sitemap/summary.html b/layouts/partials/sitemap/summary.html index 4ed5a570f5d60bc07d29393efb221e5fa06a7b8b..85e4edf81a14c7fedc7c790f755b91710a4d9224 100644 --- a/layouts/partials/sitemap/summary.html +++ b/layouts/partials/sitemap/summary.html @@ -1 +1 @@ -{{- partial "commons/summary.html" . -}} +{{- partial "commons/summary-in-content.html" . -}} diff --git a/layouts/partials/volumes/volume.html b/layouts/partials/volumes/volume.html index cdb899dd2515464f71a177c420bff335ab9345c2..d6a49058743ad40ca2f50c958cdeea92bd14ef4c 100644 --- a/layouts/partials/volumes/volume.html +++ b/layouts/partials/volumes/volume.html @@ -1,7 +1,7 @@ -<article class="volume"> +<article class="volume" itemscope itemtype="https://schema.org/Book https://schema.org/PublicationVolume"> <hgroup> - <p class="suptitle">{{ i18n "volumes.volume_number" (dict "Number" .Params.Number) }}</p> - <h2><a href="{{ .Permalink }}" title="{{ i18n "commons.more_aria" (dict "Title" .Title) }}">{{ partial "PrepareHTML" .Title }}</a></h2> + <p class="suptitle" itemprop="volumeNumber">{{ i18n "volumes.volume_number" (dict "Number" .Params.Number) }}</p> + <h2><a href="{{ .Permalink }}" title="{{ i18n "commons.more_aria" (dict "Title" .Title) }}" itemprop="name">{{ partial "PrepareHTML" .Title }}</a></h2> </hgroup> <div class="media"> {{- if .Params.image -}} diff --git a/layouts/persons/single.html b/layouts/persons/single.html index b5624399ba57384ecca368b70758c304a217e173..efba062f9ae476493e1f95f52438b38d95e788bd 100644 --- a/layouts/persons/single.html +++ b/layouts/persons/single.html @@ -36,11 +36,9 @@ <div class="informations"> <div> - {{ if (partial "GetTextFromHTML" .Params.summary) }} - <div class="lead" itemprop="description"> - {{ partial "PrepareText" .Params.summary }} - </div> - {{ end }} + {{ partial "persons/summary.html" (dict + "context" . + ) }} {{ if (partial "GetTextFromHTML" .Content) }} <div class="rich-text"> {{ partial "PrepareHTML" .Content }}