diff --git a/assets/js/theme/design-system/components/toc.js b/assets/js/theme/design-system/components/toc.js index 0ed5ba5b7..c0794117b 100644 --- a/assets/js/theme/design-system/components/toc.js +++ b/assets/js/theme/design-system/components/toc.js @@ -163,7 +163,10 @@ window.osuny.TableOfContents.prototype.updateScrollspy = function (scroll) { var container = this.state.isOffcanvas ? this.elements.nav : this.elements.content; if (this.state.currentLink && scroll > window.innerHeight) { var progress = this.getAbsoluteOffsetTop(this.state.currentLink) - container.offsetHeight / 2; - progress = this.state.isOffcanvas ? progress : progress - scroll; + var scrollLimit = this.elements.root.offsetTop + window.innerHeight; + if (!this.state.isOffcanvas) { + progress = progress - Math.min(scrollLimit, scroll); + } container.scrollTo({ top: progress }); diff --git a/assets/sass/_theme/design-system/layout.sass b/assets/sass/_theme/design-system/layout.sass index e1f122048..8bd7051ed 100644 --- a/assets/sass/_theme/design-system/layout.sass +++ b/assets/sass/_theme/design-system/layout.sass @@ -73,6 +73,8 @@ ol @include in-page-with-sidebar .heading h2, .block .block-content padding-left: offset(4) + .section-sidebar + margin-top: 0 details &:not([open]):hover diff --git a/assets/sass/_theme/design-system/meta.sass b/assets/sass/_theme/design-system/meta.sass index b1cac5465..2c4a2ea07 100644 --- a/assets/sass/_theme/design-system/meta.sass +++ b/assets/sass/_theme/design-system/meta.sass @@ -13,7 +13,7 @@ &:not(:first-child) padding-top: $spacing-2 border-top: var(--border-width) solid var(--color-border) - > ul + > ul, > :last-child text-align: right &.taxonomies padding-top: 0 diff --git a/assets/sass/_theme/design-system/single/sidebar.sass b/assets/sass/_theme/design-system/single/sidebar.sass new file mode 100644 index 000000000..94c6f47d0 --- /dev/null +++ b/assets/sass/_theme/design-system/single/sidebar.sass @@ -0,0 +1,7 @@ +.section-sidebar + @include in-page-with-sidebar + @include sidebar + @include in-page-without-sidebar + @include aside-full-width + @include media-breakpoint-down(desktop) + @include container diff --git a/assets/sass/_theme/design-system/table_of_contents.sass b/assets/sass/_theme/design-system/table_of_contents.sass index ed43851a6..2a9fb9558 100644 --- a/assets/sass/_theme/design-system/table_of_contents.sass +++ b/assets/sass/_theme/design-system/table_of_contents.sass @@ -133,11 +133,14 @@ .toc-content overflow-y: auto max-height: calc(100vh - var(--header-height)) + padding-top: var(--grid-gutter) + margin-top: var(--grid-gutter-negative) padding-bottom: $spacing-4 pointer-events: auto @include sticky($spacing-3) + transition: top $header-sticky-transition, max-height $header-sticky-transition html.is-scrolling-down & - max-height: calc(100vh - #{$spacing-3}) + max-height: calc(100vh) .toc-title color: var(--color-text-alt) button diff --git a/assets/sass/_theme/hugo-osuny.sass b/assets/sass/_theme/hugo-osuny.sass index 52708ded1..20c84fbc0 100644 --- a/assets/sass/_theme/hugo-osuny.sass +++ b/assets/sass/_theme/hugo-osuny.sass @@ -43,6 +43,7 @@ @import design-system/offcanvas @import design-system/pagination @import design-system/print +@import design-system/single/sidebar @import design-system/table @import design-system/table_of_contents @import design-system/taxonomies diff --git a/assets/sass/_theme/sections/events/single.sass b/assets/sass/_theme/sections/events/single.sass index ad0c27b3c..eb5075cbe 100644 --- a/assets/sass/_theme/sections/events/single.sass +++ b/assets/sass/_theme/sections/events/single.sass @@ -73,9 +73,6 @@ &.image-square width: columns(6) @include h3 - &:not(.full-width) - .section-sidebar - @include sidebar .programme-btn @extend .button--alt @extend .button--small diff --git a/assets/sass/_theme/sections/jobs.sass b/assets/sass/_theme/sections/jobs.sass index fa30ff35c..d2d4a7099 100644 --- a/assets/sass/_theme/sections/jobs.sass +++ b/assets/sass/_theme/sections/jobs.sass @@ -8,17 +8,3 @@ + time &::before content: ' • ' - -// sidebar -.jobs__page - &:not(.full-width) - .section-sidebar - @include sidebar - - &.full-width - .job-sidebar - @include media-breakpoint-down(desktop) - @include container - - @include media-breakpoint-up(desktop) - @include aside-full-width \ No newline at end of file diff --git a/assets/sass/_theme/sections/organizations.sass b/assets/sass/_theme/sections/organizations.sass index 79ae5ff49..f86ec23b3 100644 --- a/assets/sass/_theme/sections/organizations.sass +++ b/assets/sass/_theme/sections/organizations.sass @@ -116,15 +116,8 @@ margin-top: $spacing-4 .organizations__page - .lead - font-family: $lead-sidebar-font-family - font-weight: $lead-sidebar-weight - line-height: $lead-sidebar-line-height - margin-bottom: $spacing-3 - @include media-breakpoint-up(desktop) - font-size: $lead-sidebar-size-desktop .document-content - [itemprop="articleBody"] + .organization-logo + .organization-presentation + .organization-logo figcaption text-align: right @include meta @@ -147,6 +140,9 @@ margin-top: 0 &:not(:first-child) margin-top: $spacing-5 + &:not(.full-width) + .organization-presentation + padding-left: offset(4) @include media-breakpoint-down(md) .document-content .organization-logo @@ -159,12 +155,7 @@ display: flex justify-content: space-between gap: var(--grid-gutter) - [itemprop="articleBody"] + .organization-presentation width: columns(8) + .organization-logo - width: columns(3) - .contacts-details - ul - @include grid(2) - li - margin-top: 0 + width: columns(3) \ No newline at end of file diff --git a/assets/sass/_theme/sections/persons/single.sass b/assets/sass/_theme/sections/persons/single.sass index 7d45f15b4..b5f249bed 100644 --- a/assets/sass/_theme/sections/persons/single.sass +++ b/assets/sass/_theme/sections/persons/single.sass @@ -43,7 +43,6 @@ .blocks margin-top: $spacing-5 .person-objects - margin-top: $spacing-5 > * + * margin-top: $spacing-5 .top h2 a @@ -99,25 +98,26 @@ @include small &:hover color: var(--color-accent) + @include media-breakpoint-down(lg) .roles margin-top: $spacing-4 - @include media-breakpoint-up(lg) - .informations - @include grid - margin-bottom: $spacing-4 - .roles - grid-column: 1 / -1 - .biography - grid-column: 1 / 9 - + .roles - grid-column: 9 / 13 - text-align: right - .lead + div - margin-top: $spacing-4 - @include media-breakpoint-up(md) - .contacts-details - ul - @include grid(3) - li - margin-top: 0 + + @include media-breakpoint-up(desktop) + &.full-width + .informations + @include grid + margin-bottom: $spacing-4 + .roles + grid-column: 1 / -1 + .biography + grid-column: 1 / 9 + + .roles + grid-column: 9 / 13 + text-align: right + .lead + div + margin-top: $spacing-4 + &:not(.full-width) + .informations, + .person-objects + padding-left: offset(4) diff --git a/assets/sass/_theme/sections/posts.sass b/assets/sass/_theme/sections/posts.sass index d38f393b9..4e4d9fd98 100644 --- a/assets/sass/_theme/sections/posts.sass +++ b/assets/sass/_theme/sections/posts.sass @@ -229,9 +229,6 @@ // Safe spacing if post is empty .document-content @include document-min-height(600px) - &:not(.full-width) - .post-sidebar - @include sidebar .block-signatures .signatures border-top: var(--border-width) solid var(--color-border) @@ -263,14 +260,6 @@ + li margin-top: $spacing-3 - &.full-width - .post-sidebar - @include media-breakpoint-down(desktop) - @include container - - @include media-breakpoint-up(desktop) - @include aside-full-width - .related margin-top: $spacing-3 .posts diff --git a/assets/sass/_theme/sections/projects.sass b/assets/sass/_theme/sections/projects.sass index eef1ea66d..c203c9a26 100644 --- a/assets/sass/_theme/sections/projects.sass +++ b/assets/sass/_theme/sections/projects.sass @@ -171,19 +171,6 @@ flex-wrap: wrap li white-space: nowrap - - &:not(.full-width) - .project-sidebar - @include sidebar - - &.full-width - .project-sidebar - @include media-breakpoint-down(desktop) - @include container - - @include media-breakpoint-up(desktop) - @include aside-full-width - @include media-breakpoint-up(sm) .hero .project-infos diff --git a/assets/sass/_theme/utils/sidebar.sass b/assets/sass/_theme/utils/sidebar.sass index 5d0de5f9c..3c22cd341 100644 --- a/assets/sass/_theme/utils/sidebar.sass +++ b/assets/sass/_theme/utils/sidebar.sass @@ -35,12 +35,13 @@ @content @mixin sticky($offset-y: 0px) + --sticky-offset-y: #{$offset-y} position: sticky - top: $offset-y + top: var(--sticky-offset-y) @if $header-sticky-enabled transition: top $header-sticky-transition html:not(.is-scrolling-down) & - top: calc(var(--header-height) + #{$offset-y}) + top: calc(var(--header-height) + var(--sticky-offset-y)) @mixin sidebar($side: start) @include media-breakpoint-down(desktop) @@ -58,25 +59,23 @@ height: 100% position: absolute width: columns(4) - & > div - @include sticky($spacing-3) .toc-container - position: static + @include sticky + height: auto margin-left: 0 - &:has(aside) - .toc-container - border-top: var(--border-width) solid var(--color-border) - padding-top: $spacing-3 + &.section-sidebar--with-toc + .meta-container + margin-bottom: var(--grid-gutter) @mixin aside-full-width @include container - > div - align-items: baseline - display: flex - margin-bottom: $spacing-5 + align-items: baseline + display: flex + margin-bottom: $spacing-5 .toc-cta margin-bottom: 0 padding-right: 0 + padding-left: 0 aside flex-shrink: 0 @include media-breakpoint-down(desktop) diff --git a/bin/osuny.js b/bin/osuny.js index f2fe6cad6..a9f13f90c 100644 --- a/bin/osuny.js +++ b/bin/osuny.js @@ -39,10 +39,10 @@ let pagefindExclude = ` .block-projects, .block-publications, .block-volumes, - .persons-papers, - .persons-posts, - .persons-programs, - .persons-publications, + .person-papers, + .person-posts, + .person-programs, + .person-publications, .post-sidebar, .events, .exhibitions, diff --git a/layouts/_partials/commons/section/sidebar.html b/layouts/_partials/commons/section/sidebar.html new file mode 100644 index 000000000..03d82bd33 --- /dev/null +++ b/layouts/_partials/commons/section/sidebar.html @@ -0,0 +1,15 @@ +{{ $with_toc := partial "toc/helpers/IsPresent" .context }} +{{ $class := partial "commons/single/sidebar/helpers/GetClass" (dict + "with_meta" false + "with_toc" $with_toc + "context" .context +) }} + +{{ if $with_toc }} +
+ {{ partial "toc/container.html" (dict + "context" .context + "toc" .toc + ) }} +
+{{ end }} diff --git a/layouts/_partials/commons/single/meta.html b/layouts/_partials/commons/single/meta.html index 8310e432f..9a8d09a2e 100644 --- a/layouts/_partials/commons/single/meta.html +++ b/layouts/_partials/commons/single/meta.html @@ -1,9 +1,11 @@ {{ $meta_class := partial "commons/single/meta/helpers/GetMetaClass" . }} - - \ No newline at end of file +{{ $has_content := partial "commons/single/meta/helpers/HasContent" . }} +{{ if $has_content }} + +{{ end }} \ No newline at end of file diff --git a/layouts/_partials/commons/single/meta/authors.html b/layouts/_partials/commons/single/meta/authors.html index 933aa05c3..e90268761 100644 --- a/layouts/_partials/commons/single/meta/authors.html +++ b/layouts/_partials/commons/single/meta/authors.html @@ -1,8 +1,5 @@ -{{ $with_authors := partial "helpers/param/GetSiteParamWithDefault" (dict - "param" (printf "%s.single.meta.options.authors" .Type) - "default" "default.single.meta.options.authors" -) }} +{{ $has_authors := partial "commons/single/meta/helpers/has/Authors" . }} -{{ if $with_authors }} +{{ if $has_authors }} {{ partial "authors/partials/authors.html" . }} {{ end }} \ No newline at end of file diff --git a/layouts/_partials/commons/single/meta/contacts.html b/layouts/_partials/commons/single/meta/contacts.html new file mode 100644 index 000000000..0417b687e --- /dev/null +++ b/layouts/_partials/commons/single/meta/contacts.html @@ -0,0 +1,18 @@ +{{ $has_contacts := partial "commons/single/meta/helpers/has/Contacts" . }} +{{ $name := .Title }} +{{ $with_labels := partial "commons/single/meta/helpers/WithLabels" . }} +{{ with $has_contacts }} + {{ if or .websites .social_networks .emails .phone_numbers .phone_professional }} + {{ partial "commons/contact-details/links.html" (dict + "context" . + "name" $name + "with_labels" $with_labels + ) }} + {{ end }} + {{ if .postal_address }} + {{ partial "commons/contact-details/address.html" (dict + "postal_address" .postal_address + "with_labels" $with_labels + ) }} + {{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/_partials/commons/single/meta/dates.html b/layouts/_partials/commons/single/meta/dates.html index 4d7e82c35..853027445 100644 --- a/layouts/_partials/commons/single/meta/dates.html +++ b/layouts/_partials/commons/single/meta/dates.html @@ -1,14 +1,6 @@ {{ $with_labels := partial "commons/single/meta/helpers/WithLabels" . }} - -{{ $with_published_at := partial "helpers/param/GetSiteParamWithDefault" (dict - "param" (printf "%s.single.meta.options.published_at" .Type) - "default" "default.single.meta.options.published_at" -) }} - -{{ $with_updated_at := partial "helpers/param/GetSiteParamWithDefault" (dict - "param" (printf "%s.single.meta.options.updated_at" .Type) - "default" "default.single.meta.options.updated_at" -) }} +{{ $has_published_at := partial "commons/single/meta/helpers/has/PublishedAt" . }} +{{ $has_updated_at := partial "commons/single/meta/helpers/has/UpdatedAt" . }} {{ $date_format := partial "helpers/param/GetSiteParamWithDefault" (dict "param" (printf "%s.date_format" .Type) @@ -16,13 +8,13 @@ ) }} {{ $params := (dict - "with_published_at" $with_published_at - "with_updated_at" $with_updated_at + "has_published_at" $has_published_at + "has_updated_at" $has_updated_at "format" $date_format "context" . ) }} -{{ if or $with_published_at $with_updated_at }} +{{ if or $has_published_at $has_updated_at }} {{ if $with_labels }} {{ partial "commons/single/meta/dates/with-labels.html" $params }} {{ else }} diff --git a/layouts/_partials/commons/single/meta/dates/with-labels.html b/layouts/_partials/commons/single/meta/dates/with-labels.html index 4f02395f0..4fceaf053 100644 --- a/layouts/_partials/commons/single/meta/dates/with-labels.html +++ b/layouts/_partials/commons/single/meta/dates/with-labels.html @@ -1,4 +1,4 @@ -{{ if .with_published_at }} +{{ if .has_published_at }}
  • {{ i18n "commons.published_at" }}
  • {{ end }} -{{ if .with_updated_at }} +{{ if .has_updated_at }}
  • {{ i18n "commons.updated_at" }}
  • - {{ if .with_published_at }} + {{ if .has_published_at }} {{ i18n "commons.published_at" }} {{- end -}} - {{- if .with_updated_at -}} + {{- if .has_updated_at -}} , {{ i18n "commons.update_at_inline" }}

  • {{ partial "taxonomies/single/list.html" . }}
  • diff --git a/layouts/_partials/commons/single/sidebar.html b/layouts/_partials/commons/single/sidebar.html new file mode 100644 index 000000000..3262628a2 --- /dev/null +++ b/layouts/_partials/commons/single/sidebar.html @@ -0,0 +1,30 @@ +{{ $meta := .meta | default (partial "commons/single/meta.html" .context) }} +{{ $meta_position := partial "commons/single/meta/helpers/GetPosition" .context }} +{{ $has_meta := false }} +{{ if eq $meta_position "content" }} + {{ $has_meta = partial "commons/single/meta/helpers/HasContent" .context }} +{{ end }} + +{{ $with_toc := partial "toc/helpers/IsPresent" .context }} + +{{ $class := partial "commons/single/sidebar/helpers/GetClass" (dict + "with_meta" $has_meta + "with_toc" $with_toc + "context" .context +) }} + +{{ if or $with_toc $has_meta }} +
    + {{ if $has_meta }} + + {{ end }} + {{ if $with_toc }} + {{ partial "toc/container.html" (dict + "context" .context + "toc" .toc + ) }} + {{ end }} +
    +{{ end }} diff --git a/layouts/_partials/commons/single/sidebar/helpers/GetClass.html b/layouts/_partials/commons/single/sidebar/helpers/GetClass.html new file mode 100644 index 000000000..a40e2ab65 --- /dev/null +++ b/layouts/_partials/commons/single/sidebar/helpers/GetClass.html @@ -0,0 +1,16 @@ +{{ $class := "section-sidebar" }} +{{ $type := ( .context.Type | singularize ) }} + +{{ with $type }} + {{ $class = printf "%s section-%s" $class . }} +{{ end }} + +{{ if .with_meta }} + {{ $class = printf "%s section-sidebar--with-meta" $class }} +{{ end }} + +{{ if .with_toc }} + {{ $class = printf "%s section-sidebar--with-toc" $class }} +{{ end }} + +{{ return $class }} \ No newline at end of file diff --git a/layouts/_partials/events/single/sidebar.html b/layouts/_partials/events/single/sidebar.html index a7017a69c..9ab71c6c6 100644 --- a/layouts/_partials/events/single/sidebar.html +++ b/layouts/_partials/events/single/sidebar.html @@ -2,17 +2,15 @@ {{ $meta_position := partial "commons/single/meta/helpers/GetPosition" . }}
    -
    - {{ if eq $meta_position "content" }} - - {{ end }} - {{ partial "toc/container.html" (dict - "context" . - ) }} - {{ if $events }} - {{ i18n "events.see_programme" }} - {{ end }} -
    + {{ if eq $meta_position "content" }} + + {{ end }} + {{ partial "toc/container.html" (dict + "context" . + ) }} + {{ if $events }} + {{ i18n "events.see_programme" }} + {{ end }}
    diff --git a/layouts/_partials/exhibitions/single/sidebar.html b/layouts/_partials/exhibitions/single/sidebar.html index ca518107d..67afdaf42 100644 --- a/layouts/_partials/exhibitions/single/sidebar.html +++ b/layouts/_partials/exhibitions/single/sidebar.html @@ -1,14 +1,5 @@ -{{ $meta_position := partial "commons/single/meta/helpers/GetPosition" . }} +{{ partial "commons/single/sidebar.html" (dict + "context" . + "meta" ( partial "events/single/meta.html" . ) +) }} -
    -
    - {{ if eq $meta_position "content" }} - - {{ end }} - {{ partial "toc/container.html" (dict - "context" . - ) }} -
    -
    diff --git a/layouts/_partials/jobs/single/sidebar.html b/layouts/_partials/jobs/single/sidebar.html index 42fbe16e1..de01237d0 100644 --- a/layouts/_partials/jobs/single/sidebar.html +++ b/layouts/_partials/jobs/single/sidebar.html @@ -1,17 +1,4 @@ -{{ $meta_position := partial "commons/single/meta/helpers/GetPosition" . }} -{{ $meta_in_content := eq $meta_position "content" }} - -{{ if or .Params.design.toc.present $meta_in_content }} -
    -
    - {{ if eq $meta_position "content" }} - - {{ end }} - {{ partial "toc/container.html" (dict - "context" . - ) }} -
    -
    -{{ end }} +{{ partial "commons/single/sidebar.html" (dict + "context" . + "meta" ( partial "jobs/single/meta.html" . ) +) }} diff --git a/layouts/_partials/organizations/section.html b/layouts/_partials/organizations/section.html index 8218dcd75..ab982916a 100644 --- a/layouts/_partials/organizations/section.html +++ b/layouts/_partials/organizations/section.html @@ -3,15 +3,16 @@ {{ partial "organizations/section/hero.html" . }}
    + {{ if eq $paginator.PageNumber 1 }} + {{ partial "commons/section/sidebar.html" (dict "context" .) }} + {{ end }} + {{ partial "organizations/section/summary.html" (dict "context" . "with_container" true ) }} {{ if eq $paginator.PageNumber 1 }} - {{ partial "toc/container.html" (dict - "context" . - ) }} {{ partial "contents/list.html" (dict "context" . "contents" .Params.contents diff --git a/layouts/_partials/organizations/single.html b/layouts/_partials/organizations/single.html index af0180aef..8852f8f0e 100644 --- a/layouts/_partials/organizations/single.html +++ b/layouts/_partials/organizations/single.html @@ -2,21 +2,17 @@ {{ partial "organizations/single/pagefind.html" . }}
    - {{ partial "toc/container.html" (dict - "context" . - ) }} +
    -
    - {{ partial "organizations/single/summary.html" (dict - "context" . - ) }} +
    + {{ partial "organizations/single/summary.html" . }} {{ partial "organizations/single/presentation.html" . }} - {{ partial "taxonomies/single/container.html" . }} - {{ partial "commons/contact-details.html" (dict "subject" .) }}
    {{ partial "organizations/partials/logo.html" . }}
    + {{ partial "organizations/single/sidebar.html" . }} + {{ partial "contents/list.html" (dict "context" . "contents" .Params.contents diff --git a/layouts/_partials/organizations/single/hero.html b/layouts/_partials/organizations/single/hero.html index eab2e2322..35cee632d 100644 --- a/layouts/_partials/organizations/single/hero.html +++ b/layouts/_partials/organizations/single/hero.html @@ -3,5 +3,6 @@ "title" $title "image" .Params.image "sizes" site.Params.image_sizes.sections.organizations.hero + "meta" ( partial "organizations/single/meta.html" . ) "context" . ) -}} diff --git a/layouts/_partials/organizations/single/meta.html b/layouts/_partials/organizations/single/meta.html new file mode 100644 index 000000000..0883f9353 --- /dev/null +++ b/layouts/_partials/organizations/single/meta.html @@ -0,0 +1,6 @@ +{{ $meta_class := partial "commons/single/meta/helpers/GetMetaClass" . }} + +
      + {{ partial "commons/single/meta/taxonomies.html" . }} + {{ partial "commons/single/meta/contacts.html" . }} +
    \ No newline at end of file diff --git a/layouts/_partials/organizations/single/sidebar.html b/layouts/_partials/organizations/single/sidebar.html new file mode 100644 index 000000000..0221b4f60 --- /dev/null +++ b/layouts/_partials/organizations/single/sidebar.html @@ -0,0 +1,4 @@ +{{ partial "commons/single/sidebar.html" (dict + "context" . + "meta" ( partial "organizations/single/meta.html" . ) +) }} diff --git a/layouts/_partials/organizations/single/summary.html b/layouts/_partials/organizations/single/summary.html index 4f8311694..b5bb68fef 100644 --- a/layouts/_partials/organizations/single/summary.html +++ b/layouts/_partials/organizations/single/summary.html @@ -1 +1 @@ -{{- partial "commons/summary/container.html" . -}} +{{- partial "commons/summary/container.html" (dict "context" .) -}} diff --git a/layouts/_partials/pages/single.html b/layouts/_partials/pages/single.html index e8a68a9ee..423af4eca 100644 --- a/layouts/_partials/pages/single.html +++ b/layouts/_partials/pages/single.html @@ -1,25 +1,14 @@ -{{ $meta_position := partial "commons/single/meta/helpers/GetPosition" . }} - {{ partial "pages/single/hero.html" . }} {{ partial "pages/single/pagefind.html" . }}
    - {{ partial "toc/container.html" (dict - "toc" ( partial "pages/single/toc.html" . ) - "context" . - ) }} + {{ partial "pages/single/sidebar.html" . }} {{ partial "pages/single/summary.html" (dict "context" . "block_wrapped" true ) }} - {{ if and .Params.taxonomies (eq $meta_position "content") }} -
    - {{ partial "taxonomies/single/list.html" . }} -
    - {{ end }} - {{ if .Params.contents }} {{ partial "contents/list.html" (dict "context" . diff --git a/layouts/_partials/pages/single/meta.html b/layouts/_partials/pages/single/meta.html index 431047a9e..585d79ce0 100644 --- a/layouts/_partials/pages/single/meta.html +++ b/layouts/_partials/pages/single/meta.html @@ -1,5 +1,7 @@ {{ $meta_class := partial "commons/single/meta/helpers/GetMetaClass" . }} - -
      - {{ partial "commons/single/meta/taxonomies.html" . }} -
    \ No newline at end of file +{{ $has_taxonomies := partial "commons/single/meta/helpers/has/Taxonomies" . }} +{{ if $has_taxonomies }} +
      + {{ partial "commons/single/meta/taxonomies.html" . }} +
    +{{ end }} diff --git a/layouts/_partials/pages/single/sidebar.html b/layouts/_partials/pages/single/sidebar.html new file mode 100644 index 000000000..2555d1489 --- /dev/null +++ b/layouts/_partials/pages/single/sidebar.html @@ -0,0 +1,4 @@ +{{ partial "commons/single/sidebar.html" (dict + "context" . + "meta" ( partial "pages/single/meta.html" . ) +) }} diff --git a/layouts/_partials/papers/single/sidebar.html b/layouts/_partials/papers/single/sidebar.html index cc47fd209..c72d928d9 100644 --- a/layouts/_partials/papers/single/sidebar.html +++ b/layouts/_partials/papers/single/sidebar.html @@ -1,17 +1,15 @@ \ No newline at end of file diff --git a/layouts/_partials/persons/section.html b/layouts/_partials/persons/section.html index be53a6d31..db2dae80d 100644 --- a/layouts/_partials/persons/section.html +++ b/layouts/_partials/persons/section.html @@ -1,19 +1,17 @@ {{ partial "persons/section/hero.html" . }}
    - {{ partial "toc/container.html" (dict - "context" . - ) }} + {{ partial "commons/section/sidebar.html" (dict "context" .) }} {{ partial "persons/section/summary.html" (dict "with_container" true "context" . ) }} - {{ partial "contents/list.html" (dict - "contents" .Params.contents - "context" . - ) }} + {{ partial "contents/list.html" (dict + "contents" .Params.contents + "context" . + ) }} {{ partial "taxonomies/section/container.html" . }} diff --git a/layouts/_partials/persons/single.html b/layouts/_partials/persons/single.html index 971db9042..2de2326f8 100644 --- a/layouts/_partials/persons/single.html +++ b/layouts/_partials/persons/single.html @@ -2,16 +2,11 @@ {{ partial "persons/single/pagefind.html" . }}
    - {{ partial "toc/container.html" (dict - "context" . - "toc" ( partial "persons/single/toc.html" . ) - ) }} + {{ partial "persons/single/sidebar.html" . }}
    - {{ partial "persons/single/meta.html" . }} + {{ partial "persons/single/meta-data.html" . }} {{ partial "persons/single/informations.html" . }} - {{ partial "taxonomies/single/container.html" . }} - {{ partial "commons/contact-details.html" (dict "subject" .) }}
    {{ partial "contents/list.html" (dict diff --git a/layouts/_partials/persons/single/helpers/GetPrograms.html b/layouts/_partials/persons/single/helpers/GetPrograms.html index f082ed1f2..45984780a 100644 --- a/layouts/_partials/persons/single/helpers/GetPrograms.html +++ b/layouts/_partials/persons/single/helpers/GetPrograms.html @@ -1,5 +1,6 @@ {{- $programs := slice -}} {{ if isset site.Taxonomies .type -}} {{ $programs = index site.Taxonomies .type .slug }} + {{ $programs = where $programs "Section" "programs" }} {{- end }} {{ return $programs }} \ No newline at end of file diff --git a/layouts/_partials/persons/single/hero.html b/layouts/_partials/persons/single/hero.html index 5052047d9..bc745e35a 100644 --- a/layouts/_partials/persons/single/hero.html +++ b/layouts/_partials/persons/single/hero.html @@ -4,6 +4,7 @@ "title" $title "image" .Params.image "context" . + "meta" ( partial "persons/single/meta.html" . ) "sizes" site.Params.image_sizes.sections.persons.hero_single ) -}} diff --git a/layouts/_partials/persons/single/informations.html b/layouts/_partials/persons/single/informations.html index 2ec8fe572..4ce8b8cad 100644 --- a/layouts/_partials/persons/single/informations.html +++ b/layouts/_partials/persons/single/informations.html @@ -12,7 +12,7 @@ {{ partial "persons/single/informations/program-roles.html" (dict "programs" $administrator_programs "slug" .Slug - ) }} + ) }} {{ end }}
    {{ end }} \ No newline at end of file diff --git a/layouts/_partials/persons/single/meta-data.html b/layouts/_partials/persons/single/meta-data.html new file mode 100644 index 000000000..5d70886a5 --- /dev/null +++ b/layouts/_partials/persons/single/meta-data.html @@ -0,0 +1,14 @@ + + +{{ 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 -}} + + {{- end -}} +{{ end }} \ No newline at end of file diff --git a/layouts/_partials/persons/single/meta.html b/layouts/_partials/persons/single/meta.html index 5d70886a5..0883f9353 100644 --- a/layouts/_partials/persons/single/meta.html +++ b/layouts/_partials/persons/single/meta.html @@ -1,14 +1,6 @@ - - -{{ 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 -}} - - {{- end -}} -{{ end }} \ No newline at end of file +{{ $meta_class := partial "commons/single/meta/helpers/GetMetaClass" . }} + +
      + {{ partial "commons/single/meta/taxonomies.html" . }} + {{ partial "commons/single/meta/contacts.html" . }} +
    \ No newline at end of file diff --git a/layouts/_partials/persons/single/related.html b/layouts/_partials/persons/single/related.html index cee650e72..3f5021d76 100644 --- a/layouts/_partials/persons/single/related.html +++ b/layouts/_partials/persons/single/related.html @@ -1,6 +1,8 @@ -
    - {{ partial "persons/single/related/programs.html" . }} - {{ partial "persons/single/related/publications.html" . }} - {{ partial "persons/single/related/posts.html" . }} - {{ partial "persons/single/related/papers.html" . }} +
    +
    + {{ partial "persons/single/related/programs.html" . }} + {{ partial "persons/single/related/publications.html" . }} + {{ partial "persons/single/related/posts.html" . }} + {{ partial "persons/single/related/papers.html" . }} +
    \ No newline at end of file diff --git a/layouts/_partials/persons/single/related/papers.html b/layouts/_partials/persons/single/related/papers.html index e23c6f516..6e81f4bd6 100644 --- a/layouts/_partials/persons/single/related/papers.html +++ b/layouts/_partials/persons/single/related/papers.html @@ -2,7 +2,7 @@ {{ $papers := partial "persons/single/helpers/GetPapers" . }} {{ if $papers }} -
    +

    {{ i18n "persons.papers.recent" }}

    diff --git a/layouts/_partials/persons/single/sidebar.html b/layouts/_partials/persons/single/sidebar.html new file mode 100644 index 000000000..4693ed8d9 --- /dev/null +++ b/layouts/_partials/persons/single/sidebar.html @@ -0,0 +1,5 @@ +{{ partial "commons/single/sidebar.html" (dict + "context" . + "meta" ( partial "persons/single/meta.html" . ) + "toc" ( partial "persons/single/toc.html" . ) +) }} diff --git a/layouts/_partials/posts/single/sidebar.html b/layouts/_partials/posts/single/sidebar.html index 8faed9756..6bf9742ad 100644 --- a/layouts/_partials/posts/single/sidebar.html +++ b/layouts/_partials/posts/single/sidebar.html @@ -1,18 +1,4 @@ -{{ $meta_position := partial "commons/single/meta/helpers/GetPosition" . }} -{{ $meta_in_content := eq $meta_position "content" }} - -{{ if or .Params.design.toc.present $meta_in_content }} - -{{ end }} \ No newline at end of file +{{ partial "commons/single/sidebar.html" (dict + "context" . + "meta" ( partial "posts/single/meta.html" . ) +) }} diff --git a/layouts/_partials/projects/single/sidebar.html b/layouts/_partials/projects/single/sidebar.html index babd93ab3..2dd4f2b44 100644 --- a/layouts/_partials/projects/single/sidebar.html +++ b/layouts/_partials/projects/single/sidebar.html @@ -1,18 +1,4 @@ -{{ $meta_position := partial "commons/single/meta/helpers/GetPosition" . }} -{{ $meta_in_content := eq $meta_position "content" }} - -{{ if or .Params.design.toc.present $meta_in_content }} - -{{ end }} \ No newline at end of file +{{ partial "commons/single/sidebar.html" (dict + "context" . + "meta" ( partial "projects/single/meta.html" . ) +) }} diff --git a/layouts/_partials/researchers/section.html b/layouts/_partials/researchers/section.html index 162293ea4..946f58cd0 100644 --- a/layouts/_partials/researchers/section.html +++ b/layouts/_partials/researchers/section.html @@ -1,7 +1,6 @@ {{ partial "persons/section/hero.html" . }}
    - {{ partial "persons/section/summary.html" (dict "with_container" true "context" . diff --git a/layouts/_partials/taxonomies/helpers/GetPosition.html b/layouts/_partials/taxonomies/helpers/GetPosition.html deleted file mode 100644 index 644cf3580..000000000 --- a/layouts/_partials/taxonomies/helpers/GetPosition.html +++ /dev/null @@ -1,12 +0,0 @@ -{{ $kind := cond (or (eq .Kind "section") (eq .Kind "taxonomy")) "section" "single" }} -{{ if eq .Type "pages" }} - {{ $kind = "single" }} -{{ end }} -{{ $param := (printf "%s.%s.taxonomies.position" .Type $kind )}} - -{{ $position := partial "helpers/param/GetSiteParamWithDefault" (dict - "param" $param - "default" (printf "default.%s.taxonomies.position" $kind) -) }} - -{{ return $position }} \ No newline at end of file diff --git a/layouts/_partials/taxonomies/single/container.html b/layouts/_partials/taxonomies/single/container.html deleted file mode 100644 index e00ebf8d5..000000000 --- a/layouts/_partials/taxonomies/single/container.html +++ /dev/null @@ -1,6 +0,0 @@ -{{ $taxonomies_position := partial "taxonomies/helpers/GetPosition" . }} -{{ if and .Params.taxonomies (eq $taxonomies_position "content") }} -
    - {{ partial "taxonomies/single/list.html" . }} -
    -{{ end }} \ No newline at end of file diff --git a/layouts/_partials/toc/container.html b/layouts/_partials/toc/container.html index cf9a45515..d4d32c791 100644 --- a/layouts/_partials/toc/container.html +++ b/layouts/_partials/toc/container.html @@ -1,10 +1,6 @@ -{{ $is_toc_present := .context.Params.design.toc.present }} +{{ $is_present := partial "toc/helpers/IsPresent" .context }} -{{ if site.Params.toc.disabled }} - {{ $is_toc_present = false }} -{{ end }} - -{{ if $is_toc_present }} +{{ if $is_present }} {{ partial "toc/cta.html" }}
    diff --git a/layouts/_partials/toc/helpers/IsPresent.html b/layouts/_partials/toc/helpers/IsPresent.html new file mode 100644 index 000000000..c9c7c8cfb --- /dev/null +++ b/layouts/_partials/toc/helpers/IsPresent.html @@ -0,0 +1,7 @@ +{{ $is_present := .Params.design.toc.present }} + +{{ if site.Params.toc.disabled }} + {{ $is_present = false }} +{{ end }} + +{{ return $is_present }} \ No newline at end of file diff --git a/layouts/single.html b/layouts/single.html index ffa1f49ff..4d81d969b 100644 --- a/layouts/single.html +++ b/layouts/single.html @@ -1,25 +1,3 @@ {{ define "main" }} - {{ partial "pages/single/hero.html" . }} - -
    - {{ partial "toc/container.html" (dict - "toc" ( partial "pages/single/toc.html" . ) - "context" . - ) }} - - {{ partial "pages/single/summary.html" (dict - "context" . - "block_wrapped" true - ) }} - - {{ if .Params.contents }} - {{ partial "contents/list.html" (dict - "context" . - "contents" .Params.contents - ) }} - {{ else }} - {{ partial "pages/partials/children.html" . }} - {{ end }} -
    - + {{ partial "pages/single.html" . }} {{ end }}