diff --git a/assets/sass/_theme/sections/programs.sass b/assets/sass/_theme/sections/programs.sass index 8d730a2cbc28613268ed00aab5efe2fb5ddbc505..25847c8c2b3f45317d7a457bb2e8a11597635515 100644 --- a/assets/sass/_theme/sections/programs.sass +++ b/assets/sass/_theme/sections/programs.sass @@ -134,9 +134,12 @@ ol.programs padding: $spacing1/2 $spacing1 margin-bottom: 0 .blocks - .block-content - @include media-breakpoint-up(md) - padding-left: offset(5) + .container + padding-left: 0 + padding-right: 0 + // .block-content + // @include media-breakpoint-up(md) + // padding-left: offset(5) @include media-breakpoint-up(md) article diff --git a/layouts/administrators/list.html b/layouts/administrators/list.html index 596729af3a0730c4cfea2aeef11f0b4d7669bba4..5a3eb13252786570c1503a04a7c7596761503c65 100644 --- a/layouts/administrators/list.html +++ b/layouts/administrators/list.html @@ -7,9 +7,7 @@ {{ partial "persons/chapo.html" .Params.description_short }} </div> - {{ if .Params.blocks }} - {{ partial "blocks/list.html" .Params.blocks }} - {{ end }} + {{ partial "blocks/list.html" . }} <div class="container"> {{ partial "persons/list-specific.html" . }} diff --git a/layouts/authors/list.html b/layouts/authors/list.html index 596729af3a0730c4cfea2aeef11f0b4d7669bba4..5a3eb13252786570c1503a04a7c7596761503c65 100644 --- a/layouts/authors/list.html +++ b/layouts/authors/list.html @@ -7,9 +7,7 @@ {{ partial "persons/chapo.html" .Params.description_short }} </div> - {{ if .Params.blocks }} - {{ partial "blocks/list.html" .Params.blocks }} - {{ end }} + {{ partial "blocks/list.html" . }} <div class="container"> {{ partial "persons/list-specific.html" . }} diff --git a/layouts/diplomas/list.html b/layouts/diplomas/list.html index 66ab3db671ce993d6e583b4c30694070c6ef3b65..1a864029279a1c9c1ced2b51cfaf035b411765ea 100644 --- a/layouts/diplomas/list.html +++ b/layouts/diplomas/list.html @@ -5,7 +5,7 @@ {{ partial "diplomas/image.html" .Params.image }} {{ partial "diplomas/chapo.html" .Params.description_short }} </div> - {{ partial "blocks/list.html" .Params.blocks }} + {{ partial "blocks/list.html" . }} <div class="container"> {{ .Scratch.Set "show_programs" true }} {{ partial "diplomas/diplomas.html" . }} diff --git a/layouts/diplomas/term.html b/layouts/diplomas/term.html index 8d248e7cdd1744f4c900373280bab72d0e4dd5f0..c36411a1827a86351e738903c16f82eada324875 100644 --- a/layouts/diplomas/term.html +++ b/layouts/diplomas/term.html @@ -1,7 +1,7 @@ {{ define "main" }} {{ partial "diplomas/hero-single.html" . }} - {{ partial "blocks/list.html" .Params.blocks }} + {{ partial "blocks/list.html" . }} <div class="container"> {{ partial "programs/programs-list.html" .Pages }} </div> diff --git a/layouts/index.html b/layouts/index.html index c8d4e69c02395c11825421c5387fffc1256883fb..442b07f9a26c1c4da1ef73273ceec853ba77556e 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -3,7 +3,7 @@ {{- if .Params.blocks }} - {{- partial "blocks/list.html" .Params.blocks -}} + {{- partial "blocks/list.html" . -}} {{ else }} diff --git a/layouts/organizations/list.html b/layouts/organizations/list.html index b1d01e0597eab2084e2c345745a59f185bba911f..03c9914c1e83ec18e4892ac17f7c7b014074fedd 100644 --- a/layouts/organizations/list.html +++ b/layouts/organizations/list.html @@ -6,7 +6,5 @@ {{ partial "commons/pagination.html" . }} </div> - {{ if .Params.blocks }} - {{ partial "blocks/list.html" .Params.blocks }} - {{ end }} + {{ partial "blocks/list.html" . }} {{ end }} diff --git a/layouts/pages/list.html b/layouts/pages/list.html index f9824ccb0beb1382a1d3087d8b2609c7fcbf0f28..2ab017ceb35b8ce55444e944ed5dde57410e9d5e 100644 --- a/layouts/pages/list.html +++ b/layouts/pages/list.html @@ -17,7 +17,7 @@ "context" . ) }} - {{ partial "blocks/list.html" .Params.blocks }} + {{ partial "blocks/list.html" . }} </div> {{ else }} {{ partial "pages/image.html" .Params.image }} diff --git a/layouts/papers/list.html b/layouts/papers/list.html index 82f2c9020c3e56bbba796033aca69c79b8a3f8d5..033ee638e29a6beb5284e3fb7f53c9113206acee 100644 --- a/layouts/papers/list.html +++ b/layouts/papers/list.html @@ -10,7 +10,5 @@ {{ partial "commons/pagination.html" . }} </div> - {{ if .Params.blocks }} - {{ partial "blocks/list.html" .Params.blocks }} - {{ end }} + {{ partial "blocks/list.html" . }} {{ end }} diff --git a/layouts/partials/blocks/list.html b/layouts/partials/blocks/list.html index db77cd0c82699b7496eaecc4142c0499b3660fe0..505a5224cb73bb0a70c2048d7b8c7e05924c74d8 100644 --- a/layouts/partials/blocks/list.html +++ b/layouts/partials/blocks/list.html @@ -1,8 +1,12 @@ -{{- if . -}} +{{ $context := . }} +{{- if .Params.blocks -}} <div class="blocks"> - {{- range . -}} + {{- range .Params.blocks -}} {{ $template := printf "blocks/templates/%s.html" .template }} - {{ partial $template . }} + {{ partial $template (dict + "block" . + "context" $context + )}} {{- end -}} </div> {{- end -}} diff --git a/layouts/partials/blocks/templates/call_to_action.html b/layouts/partials/blocks/templates/call_to_action.html index 6f9b911fe0012dcb3ebf7834bd833851f9d1120f..9dfe74b758ebe66b86cf2ec1e2c79d3feecbfe5c 100644 --- a/layouts/partials/blocks/templates/call_to_action.html +++ b/layouts/partials/blocks/templates/call_to_action.html @@ -1,16 +1,17 @@ -{{- $position := .position -}} -{{- $title := .title -}} -{{- with .data -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- with .block.data -}} {{- $buttons := and .button.text .button_secondary.text -}} <section class="block-call_to_action{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> <div class="call_to_action call_to_action--with{{ if not .image }}out{{ end }}-image"> <div> - {{- if $title }} - <h2>{{ partial "PrepareHTML" $title }}</h2> - {{- end -}} - + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} {{- if (partial "GetTextFromHTML" .text) }} <div> {{ partial "PrepareHTML" .text }} diff --git a/layouts/partials/blocks/templates/chapter.html b/layouts/partials/blocks/templates/chapter.html index c1db0600e607a448693e357789e1fac18cbf5e04..a7f5a881c8e5f91ee2061459de1a61f85a2f8791 100644 --- a/layouts/partials/blocks/templates/chapter.html +++ b/layouts/partials/blocks/templates/chapter.html @@ -1,7 +1,8 @@ -{{- $position := .position -}} -{{- $title := .title -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} {{- $class := "block-chapter" -}} -{{- with .data -}} +{{- with .block.data -}} {{ if .image }} {{- $class = printf "%s block-chapter--with-image" $class -}} {{ end }} @@ -12,7 +13,10 @@ <div class="chapter"> {{ if $title -}} <div class="top"> - <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} </div> {{ end -}} {{ if (partial "GetTextFromHTML" .text) -}} diff --git a/layouts/partials/blocks/templates/contact.html b/layouts/partials/blocks/templates/contact.html index 7d207261ada840f13b5e03f6fd5ee46a9a4e10e9..26993d37d102386863e874ba81f9340396fc3ca8 100644 --- a/layouts/partials/blocks/templates/contact.html +++ b/layouts/partials/blocks/templates/contact.html @@ -1,13 +1,17 @@ -{{- $position := .position -}} -{{- $title := .title -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} {{- $class := "block-contact" -}} -{{- with .data -}} +{{- with .block.data -}} <section class="{{ $class }}{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> {{ if $title -}} <div class="top"> - <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} </div> {{ end -}} <address itemscope itemtype="https://schema.org/Organization"> diff --git a/layouts/partials/blocks/templates/datatable.html b/layouts/partials/blocks/templates/datatable.html index dfc2b4f6701bf986a854eaa5ebfdab5a048b9139..34efcbac08849263e9c6a1412e9291d99e24fae5 100644 --- a/layouts/partials/blocks/templates/datatable.html +++ b/layouts/partials/blocks/templates/datatable.html @@ -1,12 +1,17 @@ -{{- $position := .position -}} -{{- $title := .title -}} -{{- with .data -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- $title := .block.title -}} +{{- with .block.data -}} <section class="block-datatable{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> {{- if $title }} <div class="top"> - <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} </div> {{ end -}} <div class="table-responsive"> diff --git a/layouts/partials/blocks/templates/definitions.html b/layouts/partials/blocks/templates/definitions.html index 4e12b6299241f4ca3e5caed9f05e53bac9be27a6..46eb0adb17f07e3785729c91f28c5509b5db7981 100644 --- a/layouts/partials/blocks/templates/definitions.html +++ b/layouts/partials/blocks/templates/definitions.html @@ -1,12 +1,16 @@ -{{- $position := .position -}} -{{- $title := .title -}} -{{- with .data -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- with .block.data -}} <section class="block-definitions{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> {{- if $title }} <div class="top"> - <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} </div> {{ end -}} <div class="definitions"> diff --git a/layouts/partials/blocks/templates/embed.html b/layouts/partials/blocks/templates/embed.html index 71c0405a0e753274f48e5a99c69be4dcaa556581..157a4968ab61483d3119b387d58c80e11d3565ab 100644 --- a/layouts/partials/blocks/templates/embed.html +++ b/layouts/partials/blocks/templates/embed.html @@ -1,12 +1,16 @@ -{{- $position := .position -}} -{{- $title := .title -}} -{{- with .data -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- with .block.data -}} <section class="block-embed{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> {{- if $title }} <div class="top"> - <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} </div> {{ end -}} diff --git a/layouts/partials/blocks/templates/files.html b/layouts/partials/blocks/templates/files.html index d8c2a0bf9f6ee3244c1b49115ac58efa066e0153..2b81f50da4399100ffd360c599c68181ccda09f9 100644 --- a/layouts/partials/blocks/templates/files.html +++ b/layouts/partials/blocks/templates/files.html @@ -1,12 +1,16 @@ -{{- $position := .position -}} -{{- $title := .title -}} -{{- with .data -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- with .block.data -}} <section class="block-files{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> {{- if $title }} <div class="top"> - <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} </div> {{ end -}} {{- if .description }} diff --git a/layouts/partials/blocks/templates/gallery.html b/layouts/partials/blocks/templates/gallery.html index 7d958ca6db9419daeb9a0d37cbca633826db83fd..83aa6f6a4f038f5e98226e6f0a750df0e7a84a18 100644 --- a/layouts/partials/blocks/templates/gallery.html +++ b/layouts/partials/blocks/templates/gallery.html @@ -1,7 +1,8 @@ -{{- $position := .position -}} -{{- $title := .title -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} {{- $layout_class := "block-gallery--grid" -}} -{{- with .data -}} +{{- with .block.data -}} {{- $layout := .layout -}} {{- if $layout -}} {{- $layout_class = printf "block-gallery--%s" .layout -}} @@ -12,7 +13,10 @@ {{- if (or $title .description) }} <div class="top"> {{- if $title }} - <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} {{ end -}} {{- if .description }} <div class="description"> diff --git a/layouts/partials/blocks/templates/image.html b/layouts/partials/blocks/templates/image.html index cc952a4806eaeb29024e58948fa41d5fb5a3c221..84e1ab735b0012e8c16f444de2be6e6cdd902115 100644 --- a/layouts/partials/blocks/templates/image.html +++ b/layouts/partials/blocks/templates/image.html @@ -1,14 +1,11 @@ -{{- $position := .position -}} -{{- $title := .title -}} -{{- with .data -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- with .block.data -}} {{- $buttons := and .button.text .button_secondary.text -}} <section class="block-image{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> - <div> - {{- if $title }} - {{ end -}} - </div> {{/* TODO: refactor */}} {{- with .image -}} {{- $image := partial "GetMedia" .file -}} diff --git a/layouts/partials/blocks/templates/key_figures.html b/layouts/partials/blocks/templates/key_figures.html index 25e96aafbf55f3665c125ac4a936609c9e004baf..856371fef76bdb6f767bdb7a4a98536af9e738df 100644 --- a/layouts/partials/blocks/templates/key_figures.html +++ b/layouts/partials/blocks/templates/key_figures.html @@ -1,14 +1,16 @@ -{{- $position := .position -}} -{{- $title := .title -}} -{{- with .data -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- with .block.data -}} <section class="block-key_figures{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> {{- if (or $title .description) }} <div class="top"> - {{- if $title }} - <h2>{{ partial "PrepareHTML" $title }}</h2> - {{ end -}} + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} {{- if .description }} <div class="description"> {{ partial "PrepareHTML" .description }} diff --git a/layouts/partials/blocks/templates/organization_chart.html b/layouts/partials/blocks/templates/organization_chart.html index 229462fd8296e5b47164445253183ed8f163e53d..0ffa8dc37fa98a107e00f04f2d71b90978c038a9 100644 --- a/layouts/partials/blocks/templates/organization_chart.html +++ b/layouts/partials/blocks/templates/organization_chart.html @@ -1,15 +1,17 @@ -{{- $position := .position -}} -{{- $title := .title -}} -{{- with .data -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- with .block.data -}} {{- $with_link := .with_link -}} <section class="block-organization_chart{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> {{ if (or $title .description) -}} <div class="top"> - {{- if $title }} - <h2>{{ partial "PrepareHTML" $title }}</h2> - {{ end -}} + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} {{- if .description }} <div class="description"> {{ partial "PrepareHTML" .description }} diff --git a/layouts/partials/blocks/templates/pages.html b/layouts/partials/blocks/templates/pages.html index 0892765a3bbc2168aedc647b59374fe86d6d0dbf..c68b0daa1fa8ad518a3cb140444f6988c2ddf3bb 100644 --- a/layouts/partials/blocks/templates/pages.html +++ b/layouts/partials/blocks/templates/pages.html @@ -1,7 +1,8 @@ -{{- $position := .position -}} -{{- $title := .title -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} {{- $layout_class := "block-pages--grid" -}} -{{- with .data -}} +{{- with .block.data -}} {{- $layout := .layout -}} {{- $show_main_page := false -}} @@ -41,7 +42,10 @@ {{- if and $title (not $show_main_page) }} <div class="top"> - <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} </div> {{ end -}} diff --git a/layouts/partials/blocks/templates/partners.html b/layouts/partials/blocks/templates/partners.html index 2b3207b1b505598bae4170e9747cc4d7c08cf791..213740936ef6e0d376c724a8f5bc4e501b0638d5 100644 --- a/layouts/partials/blocks/templates/partners.html +++ b/layouts/partials/blocks/templates/partners.html @@ -1,13 +1,17 @@ -{{- $position := .position -}} -{{- $title := .title -}} -{{- with .data -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- with .block.data -}} <section class="block-partners{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> {{ if (or $title .description) -}} <div class="top"> {{- if $title }} - <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} {{ end -}} {{- if .description }} <div class="description"> diff --git a/layouts/partials/blocks/templates/posts.html b/layouts/partials/blocks/templates/posts.html index d43428a6f7dd55e983cefbffd8d446d8d56a47b6..210a807432df39c711abc8b2cc0f22220ab46cc5 100644 --- a/layouts/partials/blocks/templates/posts.html +++ b/layouts/partials/blocks/templates/posts.html @@ -1,7 +1,8 @@ -{{- $position := .position -}} -{{- $title := .title -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} {{- $term := false -}} -{{- with .data }} +{{- with .block.data }} {{ if .category }} {{- $term = site.GetPage (printf "/categories%s" .category) -}} {{ end }} @@ -10,15 +11,18 @@ <div class="block-content"> {{ if $title -}} <div class="top"> - <h2> - {{- if $term -}} - <a href="{{ $term.Permalink }}"> - {{- end -}} - {{- partial "PrepareHTML" $title -}} - {{- if $term -}} - </a> - {{- end -}} - </h2> + + {{ $title_link := false }} + {{- if $term }} + {{ $title_link = $term.Permalink }} + {{ end -}} + + {{ partial "blocks/title" (dict + "title" $title + "context" $context + "link" $title_link + ) }} + </div> {{- end }} diff --git a/layouts/partials/blocks/templates/programs.html b/layouts/partials/blocks/templates/programs.html index e404f8e57e708a3e027dc79b8ededcba0988ca10..d32ed8c2ae9a05178dad8018ae34425cd5f28aa0 100644 --- a/layouts/partials/blocks/templates/programs.html +++ b/layouts/partials/blocks/templates/programs.html @@ -1,12 +1,16 @@ -{{- $position := .position -}} -{{- $title := .title -}} -{{- with .data -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- with .block.data -}} <section class="block-programs{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> {{ if $title -}} <div class="top"> - <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} </div> {{ end -}} diff --git a/layouts/partials/blocks/templates/testimonials.html b/layouts/partials/blocks/templates/testimonials.html index 8a1e6d73ac2b21de1cac082def392f3d0124f0d5..a1c82e541977af08ce1855a3fab5e32534bd7734 100644 --- a/layouts/partials/blocks/templates/testimonials.html +++ b/layouts/partials/blocks/templates/testimonials.html @@ -1,8 +1,9 @@ -{{- $position := .position -}} -{{- $title := .title -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} {{- $is_carousel := false -}} -{{- with .data -}} +{{- with .block.data -}} {{ if gt (len .testimonials) 1 }} {{- $is_carousel = true -}} {{ end }} @@ -11,7 +12,10 @@ <div class="block-content"> {{ if $title -}} <div class="top"> - <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} </div> {{ end -}} diff --git a/layouts/partials/blocks/templates/timeline.html b/layouts/partials/blocks/templates/timeline.html index 0290d6c351ee9c1b4107bcf4c5411ab07f77c502..aadcf57fc9e749b809e79f78dd32e3578be582dc 100644 --- a/layouts/partials/blocks/templates/timeline.html +++ b/layouts/partials/blocks/templates/timeline.html @@ -1,10 +1,14 @@ -{{- $position := .position -}} -{{- $title := .title -}} -{{- $layout := .data.layout | default "vertical" -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- $layout := .block.data.layout | default "vertical" -}} <section class="block-timeline{{ if $title }} block-with-title{{ end }} block-timeline--{{ $layout }}" id="block-{{ $position }}"> <div class="container"> {{ $template := printf "blocks/templates/timeline/%s.html" $layout }} - {{ partial $template . }} + {{ partial $template (dict + "block" . + "context" $context + ) }} </div> </section> diff --git a/layouts/partials/blocks/templates/timeline/horizontal.html b/layouts/partials/blocks/templates/timeline/horizontal.html index a4e9bc056498707f0d1e747d7819b6a8955978fa..9b10d8667ca4477f03d037ea8d3fa687ece49031 100644 --- a/layouts/partials/blocks/templates/timeline/horizontal.html +++ b/layouts/partials/blocks/templates/timeline/horizontal.html @@ -1,6 +1,9 @@ <div class="timeline"> {{ if .title }} - <h2>{{ partial "PrepareHTML" .title }}</h2> + {{ partial "blocks/title" (dict + "title" .title + "context" .context + ) }} {{ end }} {{ with .data }} diff --git a/layouts/partials/blocks/templates/timeline/vertical.html b/layouts/partials/blocks/templates/timeline/vertical.html index 94ec914bd1836c1772c483e1279f728bb0330d0c..d3ec9fe500b9460aff74c69a00d889e439c7430b 100644 --- a/layouts/partials/blocks/templates/timeline/vertical.html +++ b/layouts/partials/blocks/templates/timeline/vertical.html @@ -1,7 +1,10 @@ <div class="block-content"> {{ if .title -}} <div class="top"> - <h2>{{ partial "PrepareHTML" .title }}</h2> + {{ partial "blocks/title" (dict + "title" .title + "context" .context + ) }} </div> {{- end }} diff --git a/layouts/partials/blocks/templates/video.html b/layouts/partials/blocks/templates/video.html index 055aaa534634eb1d80d76c71634f095da9245a12..60532489f79d896f7d1b833b8dd887238677716d 100644 --- a/layouts/partials/blocks/templates/video.html +++ b/layouts/partials/blocks/templates/video.html @@ -1,13 +1,17 @@ -{{- $position := .position -}} -{{- $title := .title -}} -{{- with .data -}} +{{- $context := .context -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- with .block.data -}} <section class="block-video{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> <div class="block-content"> <div> {{ if $title -}} <div class="top"> - <h2>{{ partial "PrepareHTML" $title }}</h2> + {{ partial "blocks/title" (dict + "title" $title + "context" $context + ) }} </div> {{ end -}} diff --git a/layouts/partials/blocks/title.html b/layouts/partials/blocks/title.html new file mode 100644 index 0000000000000000000000000000000000000000..9169f387da5c570e53cc376e3821233fc9914dc4 --- /dev/null +++ b/layouts/partials/blocks/title.html @@ -0,0 +1,23 @@ +{{- if .title }} + {{- if ne .context.Type "programs" }} + <h2> + {{- if .link -}} + <a href="{{ .link }}"> + {{- end -}} + {{ partial "PrepareHTML" .title }} + {{- if .link -}} + </a> + {{- end -}} + </h2> + {{ else }} + <h3> + {{- if .link -}} + <a href="{{ .link }}"> + {{- end -}} + {{ partial "PrepareHTML" .title }} + {{- if .link -}} + </a> + {{- end -}} + </h3> + {{ end -}} +{{ end -}} \ No newline at end of file diff --git a/layouts/partials/programs/index.html b/layouts/partials/programs/index.html index fa6ae8245e9aee8040d04c427dfd97d0067e9267..c431afc0217581749afe979d5625149ec109cfec 100644 --- a/layouts/partials/programs/index.html +++ b/layouts/partials/programs/index.html @@ -2,7 +2,7 @@ {{ partial "programs/image.html" .Params.image }} {{ partial "programs/chapo.html" .Params.description_short }} </div> -{{ partial "blocks/list.html" .Params.blocks }} +{{ partial "blocks/list.html" . }} <div class="container"> {{ partial "diplomas/diplomas-select.html" . }} {{ $programs := where .Site.Pages "Section" "programs" }} diff --git a/layouts/partials/programs/presentation.html b/layouts/partials/programs/presentation.html index 84ef52900007d2d27b1ab06b0659108914ac6efc..c2fe07dbd5184183c2a6caaeb061fe6b23ace980 100644 --- a/layouts/partials/programs/presentation.html +++ b/layouts/partials/programs/presentation.html @@ -45,6 +45,7 @@ </table> </div> </div> + {{- partial "blocks/list.html" . }} </div> </div> </section> diff --git a/layouts/partials/programs/show.html b/layouts/partials/programs/show.html index 915457e8302b3dd4cc086b85230f6af279403fa5..8b8e3fd364b5aa2d79a0c1906b399bb4fae03b45 100644 --- a/layouts/partials/programs/show.html +++ b/layouts/partials/programs/show.html @@ -20,7 +20,6 @@ </div> {{- partial "programs/children.html" .Pages -}} {{- partial "programs/presentation.html" . -}} - {{- partial "blocks/list.html" .Params.blocks -}} {{- partial "programs/pedagogy.html" . -}} {{- partial "programs/results.html" . -}} {{- partial "programs/admission.html" . -}} diff --git a/layouts/persons/list.html b/layouts/persons/list.html index 2275cd5a9107290c6c61748c868882eb07aa1b40..543a5047c0fe86b027196818b1934f549eddc772 100644 --- a/layouts/persons/list.html +++ b/layouts/persons/list.html @@ -18,8 +18,6 @@ {{- end -}} </div> - {{ if .Params.blocks }} - {{ partial "blocks/list.html" .Params.blocks }} - {{ end }} + {{ partial "blocks/list.html" . }} {{ end }} diff --git a/layouts/posts/list.html b/layouts/posts/list.html index 6b76a733e0ee06eb6e3e219d755de9db2da93cf9..428fa21c7c5aa11c69124891f6bca98634a26fa5 100644 --- a/layouts/posts/list.html +++ b/layouts/posts/list.html @@ -6,9 +6,9 @@ {{ partial "posts/image.html" .Params.image }} {{ partial "posts/chapo.html" .Params.description_short }} </div> - {{ if .Params.blocks }} - {{ partial "blocks/list.html" .Params.blocks }} - {{ end }} + + {{ partial "blocks/list.html" . }} + <div class="container"> {{ partial "posts/posts.html" . }} {{ partial "commons/pagination.html" . }} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 01a934befa53e44453f534ba86ad76a94599a2a7..49bb3bb44a9a0a3212e6a7a12843a979e35293df 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -19,7 +19,7 @@ </div> </div> </div> - {{ partial "blocks/list.html" .Params.blocks }} + {{ partial "blocks/list.html" . }} <div class="blocks blocks-pagination"> <div class="container"> <div class="block-content"> diff --git a/layouts/researchers/list.html b/layouts/researchers/list.html index 596729af3a0730c4cfea2aeef11f0b4d7669bba4..45063450678088f7672202e389fac4d027b363af 100644 --- a/layouts/researchers/list.html +++ b/layouts/researchers/list.html @@ -7,9 +7,8 @@ {{ partial "persons/chapo.html" .Params.description_short }} </div> - {{ if .Params.blocks }} - {{ partial "blocks/list.html" .Params.blocks }} - {{ end }} + + {{ partial "blocks/list.html" . }} <div class="container"> {{ partial "persons/list-specific.html" . }} diff --git a/layouts/teachers/list.html b/layouts/teachers/list.html index 596729af3a0730c4cfea2aeef11f0b4d7669bba4..45063450678088f7672202e389fac4d027b363af 100644 --- a/layouts/teachers/list.html +++ b/layouts/teachers/list.html @@ -7,9 +7,8 @@ {{ partial "persons/chapo.html" .Params.description_short }} </div> - {{ if .Params.blocks }} - {{ partial "blocks/list.html" .Params.blocks }} - {{ end }} + + {{ partial "blocks/list.html" . }} <div class="container"> {{ partial "persons/list-specific.html" . }} diff --git a/layouts/volumes/list.html b/layouts/volumes/list.html index ec0a71d99c3307fcdeffb220daea5a5d22ffc29c..e896be83b87a570c054cb0d2f9d6a62b60453bc1 100644 --- a/layouts/volumes/list.html +++ b/layouts/volumes/list.html @@ -5,7 +5,5 @@ {{ partial "commons/pagination.html" . }} </div> - {{ if .Params.blocks }} - {{ partial "blocks/list.html" .Params.blocks }} - {{ end }} + {{ partial "blocks/list.html" . }} {{ end }}