diff --git a/assets/js/theme/blocks/timeline.js b/assets/js/theme/blocks/timeline.js index 1cab898f388b1f5a5f0da6f2353673f115a033e1..bf8b9ac97730155bc496a8aa790628f7cc4f825e 100644 --- a/assets/js/theme/blocks/timeline.js +++ b/assets/js/theme/blocks/timeline.js @@ -68,21 +68,21 @@ class BlockTimeline { threshold = 30, isPointerDown = false; - this.content.style.touchAction = 'pan-y'; + this.block.style.touchAction = 'pan-y'; - this.content.addEventListener('pointerdown', (event) => { + this.block.addEventListener('pointerdown', (event) => { this.content.classList.add('is-grabbing'); startX = event.clientX; isPointerDown = true; }); - this.content.addEventListener('pointermove', (event) => { + this.block.addEventListener('pointermove', (event) => { this.isManipulated = isPointerDown; endX = event.clientX; }); endEvents.forEach(event => { - this.content.addEventListener(event, (event) => { + this.block.addEventListener(event, (event) => { isPointerDown = false; this.onManipulationEnd(startX, endX, threshold); }); diff --git a/assets/sass/_theme/blocks/video.sass b/assets/sass/_theme/blocks/video.sass index e79ec1594427eb3e43a320f95f46e381d1521f3a..6ef2f0de51ee3616d0e5cfe722c7701dc43aa4fe 100644 --- a/assets/sass/_theme/blocks/video.sass +++ b/assets/sass/_theme/blocks/video.sass @@ -68,7 +68,6 @@ @include in-page-without-sidebar background: $block-video-background - margin-top: 0 .block-content @include grid(12, false, 0) padding-top: $block-space-y diff --git a/assets/sass/_theme/design-system/hero.sass b/assets/sass/_theme/design-system/hero.sass index fb04b2d64ed700f3c5ecab17711ed15b62884462..0de31f97c3a2601d28c8500954c380cc3b87050e 100644 --- a/assets/sass/_theme/design-system/hero.sass +++ b/assets/sass/_theme/design-system/hero.sass @@ -16,9 +16,8 @@ .content align-items: start padding-top: $spacing-5 - > h1, > hgroup + .hero-text margin-top: $spacing-5 - h1 + p margin-top: $spacing-3 .lead @@ -49,7 +48,7 @@ &--with-image padding-bottom: 0 .content - > h1, > hgroup + .hero-text margin-bottom: $spacing-4 &--image-landscape .content @@ -65,14 +64,13 @@ margin-bottom: calc(#{-$spacing-7} + #{$spacing-4}) @include media-breakpoint-up(desktop) - .content - > h1, > hgroup - width: columns(9) + .hero-text + width: columns(9) &--with-image .content display: flex justify-content: space-between - > h1, > hgroup + .hero-text width: columns(7) figure width: columns(5) @@ -84,7 +82,7 @@ .breadcrumb padding-right: 10% .content - > h1, > hgroup + .hero-text width: columns(8) figure width: columns(3) diff --git a/assets/sass/_theme/sections/papers.sass b/assets/sass/_theme/sections/papers.sass index 574767937ed7a93b42c19d4bfb260b246b2721fe..427cbf18dd1546f1c6b75c7911037686f5e62e45 100644 --- a/assets/sass/_theme/sections/papers.sass +++ b/assets/sass/_theme/sections/papers.sass @@ -61,7 +61,7 @@ @include media-breakpoint-up(desktop) .hero .content - > h1, > hgroup + .hero-text width: auto .paper-sidebar > div diff --git a/assets/sass/_theme/sections/persons.sass b/assets/sass/_theme/sections/persons.sass index 92ee9eb063167e564622f316b2a505f51026502e..7f743c2a9924e8d265deb0cb52e375298d6e76e0 100644 --- a/assets/sass/_theme/sections/persons.sass +++ b/assets/sass/_theme/sections/persons.sass @@ -1,38 +1,3 @@ -.persons__page - .top - h2 - a - @include icon(arrow-right, after, true) - display: inline-flex - margin-left: $spacing-1 - transition: transform .3s ease - &:hover::after - transform: translateX($spacing-2) - // TODO : voir comment gérer les marges comme pour les blocs (pb footer) - section - padding-bottom: var(--grid-gutter) - ol.programs - li - justify-content: flex-start - @include media-breakpoint-up(desktop) - @include grid(2) - @include icon(arrow-right, after, true) - color: inherit - position: absolute - right: 0 - top: 1.5em - a - color: inherit - @include stretched-link(before) - @include media-breakpoint-down(desktop) - margin-right: $spacing-3 - p - margin-top: unset - &:nth-child(2) - @include small - &:hover - color: var(--color-accent) - .person @include article word-break: break-word @@ -162,10 +127,12 @@ ol.persons--list .persons__page .hero + figure + @extend .avatar @include media-breakpoint-down(desktop) padding-bottom: 0 margin-bottom: $spacing-6 - .avatar + figure width: columns(6) margin-top: $spacing-3 margin-left: auto @@ -173,7 +140,7 @@ ol.persons--list margin-top: calc(#{$spacing-3} - 100px) @include media-breakpoint-down(sm) margin-bottom: $spacing-6 - .avatar + figure transform: translateY(18vw) margin-top: calc(#{$spacing-3} - 18vw) @include media-breakpoint-up(desktop) @@ -185,7 +152,7 @@ ol.persons--list h1 margin-bottom: 0 width: columns(8) - .avatar + figure margin-bottom: 0 width: columns(3) .roles @@ -197,9 +164,39 @@ ol.persons--list margin-top: $spacing-5 > * + * margin-top: $spacing-5 + .top h2 a + @include icon(arrow-right, after, true) + display: inline-flex + margin-left: $spacing-1 + transition: transform .3s ease + &:hover::after + transform: translateX($spacing-2) .person-posts article.post:last-child margin-bottom: 0 + section + padding-bottom: $spacing-5 + ol.programs + li + justify-content: flex-start + @include media-breakpoint-up(desktop) + @include grid(2) + @include icon(arrow-right, after, true) + color: inherit + position: absolute + right: 0 + top: 1.5em + a + color: inherit + @include stretched-link(before) + @include media-breakpoint-down(desktop) + margin-right: $spacing-3 + p + margin-top: unset + &:nth-child(2) + @include small + &:hover + color: var(--color-accent) @include media-breakpoint-down(lg) .roles margin-top: $spacing-4 diff --git a/bin/osuny.js b/bin/osuny.js index ae7ed8de293f0d9b3f6ca537e5afee5fef6fac59..15ff7e685afe69c3073ee87680832a6b354fa41e 100644 --- a/bin/osuny.js +++ b/bin/osuny.js @@ -54,7 +54,7 @@ if (command === "dev") { if (command === "build") { execute("yarn upgrade"); - execute("hugo"); + execute("hugo --minify"); execute("npm_config_yes=true npx pagefind --site 'public' --exclude-selectors '" + pagefindExclude + "'"); } diff --git a/layouts/partials/diplomas/essential.html b/layouts/partials/diplomas/essential.html index 2f83ffad344502b63f05ccfd6f3402a52f84cdd9..63ee13a5a7130c9029a27ea1bf396ed924984bab 100644 --- a/layouts/partials/diplomas/essential.html +++ b/layouts/partials/diplomas/essential.html @@ -1,16 +1,18 @@ -{{- with . -}} - <dl class="essential"> - {{- if .Params.level -}} - <dt>{{ i18n "programs.level" }}</dt> - <dd>{{ partial "PrepareHTML" .Params.level }}</dd> - {{- end -}} - {{- if .Params.duration -}} - <dt>{{ i18n "programs.duration" }}</dt> - <dd>{{ partial "PrepareHTML" .Params.duration }}</dd> - {{- end -}} - {{- if .Params.ects -}} - <dt>{{ i18n "programs.ects_credits" }}</dt> - <dd>{{ partial "PrepareHTML" .Params.ects }}</dd> - {{- end -}} - </dl> -{{- end -}} +<div class="essential-container" id="#{{ urlize (i18n "programs.toc.essential") }}"> + <div class="container"> + <dl class="essential"> + {{- if .Params.level -}} + <dt>{{ i18n "programs.level" }}</dt> + <dd>{{ partial "PrepareHTML" .Params.level }}</dd> + {{- end -}} + {{- if .Params.duration -}} + <dt>{{ i18n "programs.duration" }}</dt> + <dd>{{ partial "PrepareHTML" .Params.duration }}</dd> + {{- end -}} + {{- if .Params.ects -}} + <dt>{{ i18n "programs.ects_credits" }}</dt> + <dd>{{ partial "PrepareHTML" .Params.ects }}</dd> + {{- end -}} + </dl> + </div> +</div> \ No newline at end of file diff --git a/layouts/partials/diplomas/hero-single.html b/layouts/partials/diplomas/hero-single.html index c45f7fb492f4beff68e818d18d512630ca48d1ca..b6b5481cdd7bd4a0dbb4764e514b5f8a9c3133dc 100644 --- a/layouts/partials/diplomas/hero-single.html +++ b/layouts/partials/diplomas/hero-single.html @@ -1,60 +1,9 @@ -{{- $breadcrumb_is_after_hero := eq site.Params.breadcrumb.position "after-hero" -}} {{- $title := or .Params.header_text .Title -}} -{{ $subtitle := "" }} -{{- $summary := .Params.summary | safeHTML -}} -{{ if and (eq site.Params.summary.position "hero") $summary }} - {{ $subtitle = $summary }} -{{ end }} - -<header class="hero {{ if $breadcrumb_is_after_hero -}} hero--no-margin {{- end }}"> - <div class="container"> - {{- if eq site.Params.breadcrumb.position "hero-start" -}} - {{- if .Params.breadcrumb | default true -}} - {{ partial "header/breadcrumbs.html" . }} - {{- end -}} - {{- end -}} - <div class="content"> - {{- if $subtitle -}} - <hgroup> - <h1>{{ partial "PrepareHTML" $title }}</h1> - <p class="lead">{{ partial "PrepareHTML" $subtitle }}</p> - </hgroup> - {{- else -}} - <h1>{{ partial "PrepareHTML" $title }}</h1> - {{- end -}} - {{- if .Params.image }} - <figure> - {{ partial "commons/image.html" - (dict - "image" .image - "sizes" site.Params.image_sizes.sections.diplomas.hero_single - ) }} - {{ if .image.credit }} - <figcaption> - {{- partial "PrepareHTML" .image.credit -}} - </figcaption> - {{ end }} - </figure> - {{ end -}} - </div> - </div> - <div class="essential-container" id="#{{ urlize (i18n "programs.toc.essential") }}"> - <div class="container"> - {{- partial "diplomas/essential" . -}} - </div> - </div> - - {{- if eq site.Params.breadcrumb.position "hero-end" -}} - {{- if .Params.breadcrumb | default true -}} - {{ partial "header/breadcrumbs.html" . }} - {{- end -}} - {{- end -}} -</header> - -{{- if $breadcrumb_is_after_hero -}} - {{- if .Params.breadcrumb | default true -}} - <div class="container breadcrumb-container"> - {{ partial "header/breadcrumbs.html" . }} - </div> - {{- end -}} -{{- end -}} \ No newline at end of file +{{ partial "header/hero.html" + (dict + "title" $title + "image" .Params.image + "sizes" site.Params.image_sizes.sections.home.hero + "context" . + "hero_complement" "diplomas/essential.html" + )}} diff --git a/layouts/partials/footer/debug.html b/layouts/partials/footer/debug.html index 552c4b804ad7b4c323268bae0aa8ec3d4c7006fe..86fc5ac335c3293104e5a8f1b37a3bab76fdc987 100644 --- a/layouts/partials/footer/debug.html +++ b/layouts/partials/footer/debug.html @@ -274,7 +274,11 @@ } function openInProd() { - console.log('{{ .Site.BaseURL }}') + // To use this debug method, add params.productionUrl key to your hugo config.yaml + const productionUrl = "{{ site.Params.debug.productionUrl }}"; + if (productionUrl) { + window.open(`${productionUrl}${window.location.pathname}`); + } } </script> \ No newline at end of file diff --git a/layouts/partials/header/hero.html b/layouts/partials/header/hero.html index 78fe93990d0d4d01863efb7f7e72523f2d24b740..af41832f8819bbdb1fd31807c30c793996d19964 100644 --- a/layouts/partials/header/hero.html +++ b/layouts/partials/header/hero.html @@ -1,51 +1,59 @@ -{{- $direction := "" -}} -{{- $breadcrumb_is_after_hero := eq site.Params.breadcrumb.position "after-hero" -}} -{{- $subtitle := .subtitle -}} -{{- $description := .description -}} + +{{ $direction := "" }} +{{ $breadcrumb_is_after_hero := eq site.Params.breadcrumb.position "after-hero" }} +{{ $display_breadcrumb := .breadcrumb | default true }} +{{ $subtitle := .subtitle }} +{{ $description := .description }} {{ if .image }} - {{- $direction = partial "GetImageDirection" .image -}} + {{ $direction = partial "GetImageDirection" .image }} {{ end }} -{{- $summary := .context.Params.summary | safeHTML -}} -{{- $subtitle_is_summary := false -}} +{{ $summary := .context.Params.summary | safeHTML }} +{{ $subtitle_is_summary := false }} {{ if not $subtitle }} {{ if and (eq site.Params.summary.position "hero") $summary }} - {{ $subtitle = $summary }} - {{ $subtitle_is_summary = true }} + {{ $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 }}"> +<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" -}} - {{- if .breadcrumb | default true -}} - {{ partial "header/breadcrumbs.html" .context }} - {{- end -}} - {{- end -}} + {{ if and $display_breadcrumb (eq site.Params.breadcrumb.position "hero-start") }} + {{ partial "header/breadcrumbs.html" .context }} + {{ end }} <div class="content"> - {{- if or $subtitle $description -}} - <hgroup> + <div class="hero-text"> + {{ if or $subtitle $description }} + <hgroup> + <h1>{{ partial "PrepareHTML" .title }}</h1> + {{ if $subtitle }} + <p {{ if $subtitle_is_summary }} class="lead" {{ end }}>{{ partial "PrepareHTML" $subtitle }}</p> + {{ end }} + {{ if $description }} + <p>{{ partial "PrepareHTML" .description }}</p> + {{ end }} + </hgroup> + {{ else }} <h1>{{ partial "PrepareHTML" .title }}</h1> - {{- if $subtitle -}} - <p {{ if $subtitle_is_summary -}} class="lead" {{- end -}}>{{ partial "PrepareHTML" $subtitle }}</p> - {{- end -}} - {{- if $description -}} - <p>{{ partial "PrepareHTML" .description }}</p> - {{- end -}} - </hgroup> - {{- else -}} - <h1>{{ partial "PrepareHTML" .title }}</h1> - {{- end -}} - {{- if .image }} + {{ end }} + {{ with .context.Params.header_cta }} + {{ if and .display .target .label }} + <a href="{{ .target }}" class="btn">{{ .label }}</a> + {{ end }} + {{ end }} + </div> + + {{ if .image }} <figure> {{ 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" -}}"> + title="{{ i18n "commons.lightbox.link.title" }}" + aria-label="{{ i18n "commons.lightbox.link.title" }}"> {{ end }} {{ partial "commons/image.html" (dict @@ -59,25 +67,26 @@ {{ if partial "GetTextFromHTML" .image.credit }} <figcaption tabindex="0"> <div class="credit-content"> - {{- partial "PrepareHTML" .image.credit -}} + {{ partial "PrepareHTML" .image.credit }} </div> </figcaption> {{ end }} </figure> - {{ end -}} + {{ end }} </div> - {{- if eq site.Params.breadcrumb.position "hero-end" -}} - {{- if .breadcrumb | default true -}} - {{ partial "header/breadcrumbs.html" .context }} - {{- end -}} - {{- end -}} </div> + + {{ if .hero_complement }} + {{ partial .hero_complement .context }} + {{ end }} + + {{ if and $display_breadcrumb (eq site.Params.breadcrumb.position "hero-end") }} + {{ partial "header/breadcrumbs.html" .context }} + {{ end }} </header> -{{- if $breadcrumb_is_after_hero -}} - {{- if .breadcrumb | default true -}} - <div class="container breadcrumb-container"> - {{ partial "header/breadcrumbs.html" .context }} - </div> - {{- end -}} -{{- end -}} \ No newline at end of file +{{ if and $display_breadcrumb $breadcrumb_is_after_hero }} + <div class="container breadcrumb-container"> + {{ partial "header/breadcrumbs.html" .context }} + </div> +{{ end }} diff --git a/layouts/partials/persons/hero-single copy.html b/layouts/partials/persons/hero-single copy.html new file mode 100644 index 0000000000000000000000000000000000000000..da41ce5514a76c6bd68d4288dcb5467879e60f84 --- /dev/null +++ b/layouts/partials/persons/hero-single copy.html @@ -0,0 +1,43 @@ +{{- $breadcrumb_is_after_hero := eq site.Params.breadcrumb.position "after-hero" -}} +{{ $subtitle := "" }} +{{- $summary := .Params.summary | safeHTML -}} +{{ if and (eq site.Params.summary.position "hero") $summary }} + {{ $subtitle = $summary }} +{{ end }} + +<header class="hero {{ if $breadcrumb_is_after_hero -}} hero--no-margin {{- end }}"> + <div class="container"> + {{- if eq site.Params.breadcrumb.position "hero-start" -}} + {{ partial "header/breadcrumbs.html" . }} + {{- end -}} + <div class="content"> + {{- if $subtitle -}} + <hgroup> + <h1>{{ partial "PrepareHTML" .Title }}</h1> + <p class="lead">{{ partial "PrepareHTML" $subtitle }}</p> + </hgroup> + {{- else -}} + <h1>{{ partial "PrepareHTML" .Title }}</h1> + {{- end -}} + + {{ if .Params.image }} + <div class="avatar"> + {{ partial "commons/image.html" + (dict + "image" .Params.image + "sizes" site.Params.image_sizes.sections.persons.hero_single + )}} + </div> + {{ end }} + </div> + {{- if eq site.Params.breadcrumb.position "hero-end" -}} + {{ partial "header/breadcrumbs.html" . }} + {{- end -}} + </div> +</header> + +{{- if $breadcrumb_is_after_hero -}} + <div class="container breadcrumb-container"> + {{ partial "header/breadcrumbs.html" . }} + </div> +{{- end -}} \ No newline at end of file diff --git a/layouts/partials/persons/hero-single.html b/layouts/partials/persons/hero-single.html index da41ce5514a76c6bd68d4288dcb5467879e60f84..a79151b4e11c71d79d6d46895a1d43b42b98c100 100644 --- a/layouts/partials/persons/hero-single.html +++ b/layouts/partials/persons/hero-single.html @@ -1,43 +1,8 @@ -{{- $breadcrumb_is_after_hero := eq site.Params.breadcrumb.position "after-hero" -}} -{{ $subtitle := "" }} -{{- $summary := .Params.summary | safeHTML -}} -{{ if and (eq site.Params.summary.position "hero") $summary }} - {{ $subtitle = $summary }} -{{ end }} - -<header class="hero {{ if $breadcrumb_is_after_hero -}} hero--no-margin {{- end }}"> - <div class="container"> - {{- if eq site.Params.breadcrumb.position "hero-start" -}} - {{ partial "header/breadcrumbs.html" . }} - {{- end -}} - <div class="content"> - {{- if $subtitle -}} - <hgroup> - <h1>{{ partial "PrepareHTML" .Title }}</h1> - <p class="lead">{{ partial "PrepareHTML" $subtitle }}</p> - </hgroup> - {{- else -}} - <h1>{{ partial "PrepareHTML" .Title }}</h1> - {{- end -}} - - {{ if .Params.image }} - <div class="avatar"> - {{ partial "commons/image.html" - (dict - "image" .Params.image - "sizes" site.Params.image_sizes.sections.persons.hero_single - )}} - </div> - {{ end }} - </div> - {{- if eq site.Params.breadcrumb.position "hero-end" -}} - {{ partial "header/breadcrumbs.html" . }} - {{- end -}} - </div> -</header> - -{{- if $breadcrumb_is_after_hero -}} - <div class="container breadcrumb-container"> - {{ partial "header/breadcrumbs.html" . }} - </div> -{{- end -}} \ No newline at end of file +{{- $title := or .Params.header_text .Title -}} +{{- partial "header/hero.html" + (dict + "title" $title + "image" (dict "id" .Params.image) + "context" . + "sizes" site.Params.image_sizes.sections.persons.hero_single + ) -}} diff --git a/layouts/partials/programs/essential.html b/layouts/partials/programs/essential.html index bc5730ecf4c104fa7e239272a49519bf7eee7e05..f0e689084075bb3ddbe63f9bcf648b7c21897eab 100644 --- a/layouts/partials/programs/essential.html +++ b/layouts/partials/programs/essential.html @@ -1,22 +1,46 @@ -{{ $parent := .Params.parent }} -{{- with .Params.diplomas -}} - {{- $diploma := site.GetPage (printf "/diplomas/%s" .) -}} - {{- with $diploma -}} - <dl class="essential"> - <dt>{{ i18n "programs.diploma" }}</dt> - <dd><a href="{{ .Permalink }}">{{ partial "PrepareHTML" .Title }}</a></dd> - {{- if .Params.level -}} - <dt>{{ i18n "programs.level" }}</dt> - <dd>{{ partial "PrepareHTML" .Params.level }}</dd> +<div class="essential-container" id="#{{ urlize (i18n "programs.toc.essential") }}"> + <div class="container"> + + {{ $parent := .Params.parent }} + {{- with .Params.diplomas -}} + {{- $diploma := site.GetPage (printf "/diplomas/%s" .) -}} + {{- with $diploma -}} + <dl class="essential"> + <dt>{{ i18n "programs.diploma" }}</dt> + <dd><a href="{{ .Permalink }}">{{ partial "PrepareHTML" .Title }}</a></dd> + {{- if .Params.level -}} + <dt>{{ i18n "programs.level" }}</dt> + <dd>{{ partial "PrepareHTML" .Params.level }}</dd> + {{- end -}} + {{- with $parent -}} + <dt>{{ i18n "programs.mention" }}</dt> + <dd><a href="{{ .url }}">{{ partial "PrepareHTML" .title }}</a></dd> + {{- end -}} + {{- if .Params.duration -}} + <dt>{{ i18n "programs.duration" }}</dt> + <dd>{{ partial "PrepareHTML" .Params.duration }}</dd> + {{- end -}} + </dl> {{- end -}} - {{- with $parent -}} - <dt>{{ i18n "programs.mention" }}</dt> - <dd><a href="{{ .url }}">{{ partial "PrepareHTML" .title }}</a></dd> - {{- end -}} - {{- if .Params.duration -}} - <dt>{{ i18n "programs.duration" }}</dt> - <dd>{{ partial "PrepareHTML" .Params.duration }}</dd> - {{- end -}} - </dl> - {{- end -}} -{{- end -}} + {{- end -}} + + <div class="buttons"> + <div class="dropdown-share dropup"> + <button type="button" id="shareProgram" data-bs-toggle="dropdown" aria-expanded="false">{{ i18n "commons.share" }}</button> + <div class="dropdown-menu"> + {{ partial "commons/share.html" . }} + </div> + </div> + {{ with .Params.downloadable_summary }} + {{- $file := partial "GetMedia" . -}} + {{- if $file -}} + {{- $url := $file.url -}} + {{- if site.Params.keycdn -}} + {{- $url = $file.direct_url -}} + {{- end -}} + <a href="{{ $url }}" download target="_blank">{{ i18n "commons.download.singular_name" }}</a> + {{- end -}} + {{ end }} + </div> + </div> +</div> diff --git a/layouts/partials/programs/hero-single.html b/layouts/partials/programs/hero-single.html index deb0f4ae2da54d0047773693e12b80cc92142c9d..96357ec373647c0e43568e650525330e607e3b04 100644 --- a/layouts/partials/programs/hero-single.html +++ b/layouts/partials/programs/hero-single.html @@ -1,65 +1,7 @@ -{{- $breadcrumb_is_after_hero := eq site.Params.breadcrumb.position "after-hero" -}} {{- $title := or .Params.header_text .Title -}} -{{ $subtitle := "" }} -{{- $summary := .Params.summary | safeHTML -}} -{{ if and (eq site.Params.summary.position "hero") $summary }} - {{ $subtitle = $summary }} -{{ end }} - -<header class="hero hero-program {{ if $breadcrumb_is_after_hero -}} hero--no-margin {{- end }}"> - <div class="container"> - {{- if eq site.Params.breadcrumb.position "hero-start" -}} - {{- if .Params.breadcrumb | default true -}} - {{ partial "header/breadcrumbs.html" . }} - {{- end -}} - {{- end -}} - <div class="content"> - {{- if $subtitle -}} - <hgroup> - <h1>{{ partial "PrepareHTML" $title }}</h1> - <p class="lead">{{ partial "PrepareHTML" $subtitle }}</p> - </hgroup> - {{- else -}} - <h1>{{ partial "PrepareHTML" $title }}</h1> - {{- end -}} - </div> - </div> - - <div class="essential-container" id="#{{ urlize (i18n "programs.toc.essential") }}"> - <div class="container"> - {{- partial "programs/essential" . -}} - <div class="buttons"> - <div class="dropdown-share dropup"> - <button type="button" id="shareProgram" data-bs-toggle="dropdown" aria-expanded="false">{{ i18n "commons.share" }}</button> - <div class="dropdown-menu"> - {{ partial "commons/share.html" . }} - </div> - </div> - {{ with .Params.downloadable_summary }} - {{- $file := partial "GetMedia" . -}} - {{- if $file -}} - {{- $url := $file.url -}} - {{- if site.Params.keycdn -}} - {{- $url = $file.direct_url -}} - {{- end -}} - <a href="{{ $url }}" download target="_blank">{{ i18n "commons.download.singular_name" }}</a> - {{- end -}} - {{ end }} - </div> - </div> - </div> - - {{- if eq site.Params.breadcrumb.position "hero-end" -}} - {{- if .Params.breadcrumb | default true -}} - {{ partial "header/breadcrumbs.html" . }} - {{- end -}} - {{- end -}} -</header> - -{{- if $breadcrumb_is_after_hero -}} - {{- if .Params.breadcrumb | default true -}} - <div class="container breadcrumb-container"> - {{ partial "header/breadcrumbs.html" . }} - </div> - {{- end -}} -{{- end -}} +{{ partial "header/hero.html" + (dict + "title" $title + "context" . + "hero_complement" "programs/essential.html" + )}}