diff --git a/assets/sass/_theme/_configuration.sass b/assets/sass/_theme/_configuration.sass index d3c9b50c0365ca8c66786d59768988c2073e5cea..b0abc58c1a568c5e10a90261b31909fc3be10276 100644 --- a/assets/sass/_theme/_configuration.sass +++ b/assets/sass/_theme/_configuration.sass @@ -191,7 +191,6 @@ $hero-color: $color-text !default $hero-background-color: $color-background-alt !default // Breadcrumb -$breadcrumb-below-h1: false !default // NOT READY YET! $breadcrumb-color: $hero-color !default $breadcrumb-color-active: $hero-color !default $breadcrumb-icon: "caret-right" !default @@ -337,8 +336,6 @@ $article-media-aspect-ratio: 2 !default $post-media-background: $article-media-background !default $post-categories-color: color-contrast($color-text, 20%) !default $post-time-color: $color-text-alt !default -// Layout posts list (ne concerne pas les blocks posts) -$posts-layout-list: true !default // Si layout posts grid (ne concerne pas les blocks posts) $posts-grid-columns: $block-posts-grid-columns !default diff --git a/assets/sass/_theme/blocks/organization_chart.sass b/assets/sass/_theme/blocks/organization_chart.sass index e13111d17634aca4ec0138dfcffa60abfebb95d2..dafec2c9ab95304bea50d28294dcae2b513bfe1a 100644 --- a/assets/sass/_theme/blocks/organization_chart.sass +++ b/assets/sass/_theme/blocks/organization_chart.sass @@ -1,33 +1,18 @@ .block-organization_chart - article - position: relative - .name - @include h4 - a - @include stretched-link - text-decoration: none - + p - margin-top: half($spacing0) - @include in-page-with-sidebar .persons @include grid(1, sm) @include grid(2, desktop) article flex-direction: row - align-items: start .avatar + flex-shrink: 0 margin-right: $spacing1 width: calc(#{col(1, 4)} + #{$grid-gutter}) .description - flex: 1 margin-top: $spacing1 @include media-breakpoint-up(sm) @include in-page-without-sidebar .persons @include grid(4, lg) - @include grid(6, xl) - article - text-align: center - .avatar - width: 100% \ No newline at end of file + @include grid(6, xl) \ No newline at end of file diff --git a/assets/sass/_theme/sections/persons.sass b/assets/sass/_theme/sections/persons.sass index aaf490bccf4383afe564797a533cee890bc3db42..ec12c21b3e1694806f2eb7e9372a917e21c1b1e1 100644 --- a/assets/sass/_theme/sections/persons.sass +++ b/assets/sass/_theme/sections/persons.sass @@ -31,38 +31,39 @@ margin-bottom: $spacing1 order: -1 width: px2rem(76) - .name - margin-bottom: px2rem(5) - // & ~ p - // @include small - + @include h4 + a + @include stretched-link + text-decoration: none + + p + margin-top: half($spacing0) .description @include small - - @include media-breakpoint-down(desktop) - display: block - &::after - content: '' - clear: both - display: table - > div:first-of-type - float: left - max-width: calc(100% - 6rem) + @include media-breakpoint-down(md) + flex-direction: row + justify-content: space-between .avatar - float: right + align-self: start + flex-shrink: 0 + order: 2 + margin-left: $spacing0 margin-bottom: 0 - + @include media-breakpoint-up(desktop) + @include in-page-without-sidebar + text-align: center + .avatar + width: 100% section.persons, div.persons @include grid(1) @include grid(2, md) @include grid(3, lg) - @include grid(4, xl) - @include grid(5, xxl) + @include grid(5, xl) + @include grid(6, xxl) -ol.persons +ol.persons--list @include list-reset > li border-bottom: 1px solid $color-border diff --git a/assets/sass/_theme/sections/posts.sass b/assets/sass/_theme/sections/posts.sass index 48a556b9ba4a3130037e71b98b4a9fa67c5530eb..2e8688af9278fa2ff4b7fe12f32ab6e4d65b9aee 100644 --- a/assets/sass/_theme/sections/posts.sass +++ b/assets/sass/_theme/sections/posts.sass @@ -20,54 +20,52 @@ .authors__term, .categories__term, .persons__page - @if $posts-layout-list - .posts - article - border-bottom: 1px solid $color-border - display: flex - margin-bottom: $spacing1 - padding-bottom: $spacing1 - flex-direction: row - h1 + p - margin-top: $spacing0 - @include media-breakpoint-up(desktop) - @include grid - margin-bottom: $spacing3 - padding-bottom: $spacing3 - div:not(.media) - grid-column: 4/13 - @include media-breakpoint-down(desktop) - flex: 1 - margin-left: $spacing0 - p:not(.title) - @include media-breakpoint-down(desktop) - display: none - .media - background: none - margin: 0 + + .posts--list + article + border-bottom: 1px solid $color-border + display: flex + margin-bottom: $spacing1 + padding-bottom: $spacing1 + flex-direction: row + h1 + p + margin-top: $spacing0 + @include media-breakpoint-up(desktop) + @include grid + margin-bottom: $spacing3 + padding-bottom: $spacing3 + div:not(.media) + grid-column: 4/13 + @include media-breakpoint-down(desktop) + flex: 1 + margin-left: $spacing0 + p:not(.title) @include media-breakpoint-down(desktop) - width: 33.33333% - @include media-breakpoint-up(desktop) - grid-column: 1/4 - &, img - aspect-ratio: auto + display: none + .media + background: none + margin: 0 + @include media-breakpoint-down(desktop) + width: 33.33333% @include media-breakpoint-up(desktop) - time - font-size: $h5-size - position: absolute - right: 0 - top: 0 - div:not(.media) - h1, - p, - a - max-width: col(6, 9) - - @else - .posts - @include grid(1) - @include grid(2, desktop) - @include grid($posts-grid-columns, xxl) + grid-column: 1/4 + &, img + aspect-ratio: auto + @include media-breakpoint-up(desktop) + time + font-size: $h5-size + position: absolute + right: 0 + top: 0 + div:not(.media) + h1, + p, + a + max-width: col(6, 9) + .posts--grid + @include grid(1) + @include grid(2, desktop) + @include grid($posts-grid-columns, xxl) .posts__page @include media-breakpoint-down(desktop) diff --git a/config.yaml b/config.yaml index 6d864183673ff7221cddef657f6e103b1f450fe5..a3e5b61ea5713611f8dea419a1493ada6b3ae9be 100644 --- a/config.yaml +++ b/config.yaml @@ -7,13 +7,16 @@ params: breadcrumb: position: hero-start # hero-start | hero-end | after-hero posts: - list: + index: show_categories: false truncate_description: 200 # Set to 0 to disable truncate layout: list # grid | list pages: - list: + index: truncate_description: 200 # Set to 0 to disable truncate + persons: + index: + layout: grid # grid | list home: toc: disabled: true diff --git a/layouts/partials/blocks/templates/organization_chart.html b/layouts/partials/blocks/templates/organization_chart.html index b202beb7bc9986e5c9238b8d31323c1dd02576f6..8258d85a74cb6413cdc7e13465edde3f8548a0be 100644 --- a/layouts/partials/blocks/templates/organization_chart.html +++ b/layouts/partials/blocks/templates/organization_chart.html @@ -23,41 +23,40 @@ <div class="persons"> {{- range .persons -}} {{ $person := site.GetPage (printf "/persons/%s" .slug) }} - <div> - <article class="person" itemscope itemtype="https://schema.org/Person"> - <div class="description"> - <h1 class="name" itemprop="name"> - {{ if $with_link }} - <a href="{{ $person.Permalink }}" aria-label="{{ i18n "commons.more_aria" (dict "Title" $person.Title) }}"> - {{ end }} - {{- partial "PrepareHTML" $person.Title -}} - {{ if $with_link }} - </a> + <article class="person" itemscope itemtype="https://schema.org/Person"> + <div class="description"> + <h1 class="name" itemprop="name"> + {{ if $with_link }} + <a href="{{ $person.Permalink }}" aria-label="{{ i18n "commons.more_aria" (dict "Title" $person.Title) }}"> {{ end }} - </h1> - <p itemprop="jobTitle"> - {{- if (partial "GetTextFromHTML" .role) }} - {{ partial "PrepareHTML" .role }} - {{- else if partial "GetTextFromHTML" $person.Params.summary }} - {{- partial "PrepareHTML" $person.Params.summary -}} - {{ else if (partial "GetTextFromHTML" $person.Content) }} - {{- partial "GetTruncateContent" ( dict "text" $person.Content ) -}} - {{ end -}} - </p> + {{- partial "PrepareHTML" $person.Title -}} + {{ if $with_link }} + </a> + {{ end }} + </h1> + <p itemprop="jobTitle"> + {{- if (partial "GetTextFromHTML" .role) }} + {{ partial "PrepareHTML" .role }} + {{- else if partial "GetTextFromHTML" $person.Params.summary }} + {{- partial "PrepareHTML" $person.Params.summary -}} + {{ else if (partial "GetTextFromHTML" $person.Content) }} + {{- partial "GetTruncateContent" ( dict "text" $person.Content ) -}} + {{ end -}} + </p> + </div> + {{- if $with_photo }} + <div class="avatar" itemprop="image"> + {{- if $person.Params.image }} + {{ partial "commons/image.html" + (dict + "image" $person.Params.image + "sizes" site.Params.image_sizes.blocks.organization_chart + )}} + {{ end -}} </div> - {{- if $with_photo }} - <div class="avatar" itemprop="image"> - {{- if $person.Params.image }} - {{ partial "commons/image.html" - (dict - "image" $person.Params.image - "sizes" site.Params.image_sizes.blocks.organization_chart - )}} - {{ end -}} - </div> - {{ end -}} - </article> - </div> + {{ end -}} + </article> + {{- end -}} </div> </div> diff --git a/layouts/partials/blocks/templates/pages.html b/layouts/partials/blocks/templates/pages.html index d39d519379cafb6597fcdc601b3e1e2f74f85006..83bd699e6ae373f5d56b137819df8c9047e08297 100644 --- a/layouts/partials/blocks/templates/pages.html +++ b/layouts/partials/blocks/templates/pages.html @@ -40,10 +40,10 @@ {{- $page_class = partial "GetBodyclass" . }} {{- $page_class = printf "block-%s" $page_class }} {{ end }} - {{ if site.Params.pages.list.truncate_description }} + {{ if site.Params.pages.index.truncate_description }} {{- $main_description = partial "GetTruncateContent" ( dict "text" .Params.summary - "length" site.Params.pages.list.truncate_description + "length" site.Params.pages.index.truncate_description ) -}} {{ else }} {{- $main_description = partial "PrepareHTML" .Params.summary -}} diff --git a/layouts/partials/blocks/templates/pages/cards.html b/layouts/partials/blocks/templates/pages/cards.html index 6fd3e56ee05c47f4a8f7d8859b4ea57561c772df..3dc759281c2e75c0339fc6177b755ede0041af77 100644 --- a/layouts/partials/blocks/templates/pages/cards.html +++ b/layouts/partials/blocks/templates/pages/cards.html @@ -17,10 +17,10 @@ </h1> {{ if and $show_descriptions .Params.summary }} - {{ if site.Params.pages.list.truncate_description }} + {{ if site.Params.pages.index.truncate_description }} <p>{{ partial "GetTruncateContent" ( dict "text" .Params.summary - "length" site.Params.pages.list.truncate_description + "length" site.Params.pages.index.truncate_description ) }}</p> {{ else }} <p>{{ partial "PrepareHTML" .Params.summary }}</p> diff --git a/layouts/partials/blocks/templates/pages/grid.html b/layouts/partials/blocks/templates/pages/grid.html index 07f582594b3a9b5a0f7afef99bf84c29e8ed07f5..4aefaa7586a686e4d0529fb2e47f89cfa355588f 100644 --- a/layouts/partials/blocks/templates/pages/grid.html +++ b/layouts/partials/blocks/templates/pages/grid.html @@ -25,10 +25,10 @@ </a> </h1> {{ if and $show_descriptions .Params.summary }} - {{ if site.Params.pages.list.truncate_description }} + {{ if site.Params.pages.index.truncate_description }} <p>{{ partial "GetTruncateContent" ( dict "text" .Params.summary - "length" site.Params.pages.list.truncate_description + "length" site.Params.pages.index.truncate_description ) }}</p> {{ else }} <p>{{ partial "PrepareHTML" .Params.summary }}</p> diff --git a/layouts/partials/blocks/templates/posts/highlight.html b/layouts/partials/blocks/templates/posts/highlight.html index 3d606923ce43bab4fa6bb9e10e0eb6b5597ada66..6c3369909d8f34ca859e0a85bb4cb153036da4b9 100644 --- a/layouts/partials/blocks/templates/posts/highlight.html +++ b/layouts/partials/blocks/templates/posts/highlight.html @@ -18,14 +18,14 @@ <article class="post"> {{- $title := partial "PrepareHTML" .Title -}} <h1 itemprop="headline"><a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a></h1> - {{ if site.Params.posts.list.show_categories }} + {{ if site.Params.posts.index.show_categories }} {{- partial "posts/categories" . -}} {{ end }} {{- if (partial "GetTextFromHTML" .Params.summary) -}} - {{ if site.Params.posts.list.truncate_description }} + {{ if site.Params.posts.index.truncate_description }} <p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict "text" .Params.summary - "length" site.Params.posts.list.truncate_description + "length" site.Params.posts.index.truncate_description ) }}</p> {{ else }} <p itemprop="articleBody">{{ partial "PrepareHTML" .Params.summary }}</p> diff --git a/layouts/partials/persons/list-specific.html b/layouts/partials/persons/list-specific.html index 605023a4f10c726621c7c081a1e33b090111f451..5b02131199e42a106ec97089acbda7f3f2d41e7b 100644 --- a/layouts/partials/persons/list-specific.html +++ b/layouts/partials/persons/list-specific.html @@ -1,14 +1,14 @@ -<ol class="persons"> - {{ range (.Paginate (.Pages.ByParam "last_name")).Pages }} - {{ if .Slug }} - {{ $slug := printf "/persons/%s" .Slug }} - {{ $person := site.GetPage $slug }} - {{ if $person }} - {{ with $person }} - {{ partial "persons/list-item" $person }} - {{ end }} - {{ end }} +{{ $persons := slice }} + +{{ range (.Paginate (.Pages.ByParam "last_name")).Pages }} + {{ if .Slug }} + {{ $slug := printf "/persons/%s" .Slug }} + {{ $person := site.GetPage $slug }} + {{ if $person }} + {{ $persons = $persons | append $person }} {{ end }} {{ end }} -</ol> +{{ end }} + +{{ partial "persons/list.html" (dict "persons" $persons) }} {{ partial "commons/pagination.html" . }} diff --git a/layouts/partials/persons/list.html b/layouts/partials/persons/list.html index 77a53118ffd00784b31fcfd602c7e429608f53a1..9edc780d68ca0968021de3851db7f69bbca2fa4f 100644 --- a/layouts/partials/persons/list.html +++ b/layouts/partials/persons/list.html @@ -1,7 +1,13 @@ -<ol class="persons"> - {{ $persons := .Pages.ByParam "last_name" }} - {{ range (.Paginate $persons).Pages }} - {{ partial "persons/list-item" . }} - {{ end }} -</ol> -{{ partial "commons/pagination.html" . }} +{{ if eq site.Params.persons.index.layout "list" }} + <ol class="persons persons--list"> + {{ range .persons }} + {{ partial "persons/list-item" . }} + {{ end }} + </ol> +{{ else if eq site.Params.persons.index.layout "grid" }} + <div class="persons"> + {{ range .persons }} + {{ partial "persons/person" . }} + {{ end }} + </div> +{{ end }} diff --git a/layouts/partials/posts/block-posts-layout.html b/layouts/partials/posts/block-posts-layout.html index 195e1fc31602278540268e911b96f89a681db422..24a46ee469fee178fce5886846405bac732d2f6f 100644 --- a/layouts/partials/posts/block-posts-layout.html +++ b/layouts/partials/posts/block-posts-layout.html @@ -1,4 +1,4 @@ -{{ $layout := site.Params.posts.list.layout | default "list" }} +{{ $layout := site.Params.posts.index.layout | default "list" }} <div class="block-posts block-posts--{{- $layout -}}"> <div class="container"> <div class="block-content"> diff --git a/layouts/partials/posts/post.html b/layouts/partials/posts/post.html index 3a10c62d42cd5bb344966a727f7f178a910e6d7e..ea01cfd3f577cd5f2b8b1f831f925984ca5f5adf 100644 --- a/layouts/partials/posts/post.html +++ b/layouts/partials/posts/post.html @@ -2,14 +2,14 @@ <div class="post-content"> {{- $title := partial "PrepareHTML" .Title -}} <h1 itemprop="headline"><a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a></h1> - {{ if $.Site.Params.posts.list.show_categories }} + {{ if $.Site.Params.posts.index.show_categories }} {{- partial "posts/categories" . -}} {{ end }} {{- if (partial "GetTextFromHTML" .Params.summary) -}} - {{ if $.Site.Params.posts.list.truncate_description }} + {{ if $.Site.Params.posts.index.truncate_description }} <p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict "text" .Params.summary - "length" $.Site.Params.posts.list.truncate_description + "length" $.Site.Params.posts.index.truncate_description ) }}</p> {{ else }} <p itemprop="articleBody">{{ partial "PrepareHTML" .Params.summary }}</p> diff --git a/layouts/partials/posts/posts.html b/layouts/partials/posts/posts.html index 7a0a4cfda055f218e77bd5b1d144bebcca1550a8..0dd9340c6dde4de13fcac1b4beda6444411d764f 100644 --- a/layouts/partials/posts/posts.html +++ b/layouts/partials/posts/posts.html @@ -1,4 +1,4 @@ -<div class="posts"> +<div class="posts posts--{{- site.Params.posts.index.layout -}}"> {{ if not .Pages }} <p>{{ i18n "categories.no_post" }}</p> {{ end }} diff --git a/layouts/partials/programs/chapters.html b/layouts/partials/programs/chapters.html deleted file mode 100644 index 4e208f716408efd75e77ac05abff3386f79035c1..0000000000000000000000000000000000000000 --- a/layouts/partials/programs/chapters.html +++ /dev/null @@ -1,30 +0,0 @@ -<div itemprop="articleBody"> - {{- $params := .params -}} - {{- $contactsExist := or $params.contacts $params.roles -}} - {{- range .chapters -}} - {{- $content := index $params . -}} - {{- $chapterExists := $content -}} - {{ if eq "contacts" . }} - {{- $chapterExists = $contactsExist -}} - {{ end }} - {{- if $chapterExists }} - <section> - {{ $title := i18n (printf "programs._%s" .) -}} - <h2 id="page-{{ . }}">{{ $title }}</h2> - {{ if eq . "contacts" }} - {{- partial "programs/content.html" $content -}} - {{- partial "programs/roles.html" $params.roles -}} - {{ else if eq . "teachers" }} - {{- partial "programs/teachers.html" - (dict - "title" $title - "teachers" $params.teachers - "descriptions" $params.teachers_description - ) -}} - {{ else }} - {{- partial "programs/content.html" $content -}} - {{ end }} - </section> - {{ end -}} - {{- end -}} -</div> diff --git a/layouts/partials/programs/roles.html b/layouts/partials/programs/roles.html deleted file mode 100644 index 0fa6b0b5a37a761ea63415e1aa3cd9acdbf55c04..0000000000000000000000000000000000000000 --- a/layouts/partials/programs/roles.html +++ /dev/null @@ -1,29 +0,0 @@ -{{- range . }} - <h3>{{ .title }}</h3> - <div class="persons"> - {{- range .persons -}} - {{ $slug := . }} - {{ with site.GetPage "persons" }} - {{ with .GetPage $slug }} - <div> - <div class="person"> - <p class="name"> - <a href="{{ .Permalink }}">{{ partial "PrepareHTML" .Title }}</a> - </p> - {{ if .Params.email }} - <p class="contact"> - <a href="mailto:{{ .Params.email }}" rel="noreferrer" target="_blank">{{ .Params.email }}</a> - </p> - {{ end }} - {{ if .Params.phone }} - <p class="contact"> - {{ safeHTML .Params.phone }} - </p> - {{ end }} - </div> - </div> - {{ end }} - {{ end }} - {{ end }} - </div> -{{ end -}} diff --git a/layouts/persons/list.html b/layouts/persons/list.html index 209dff5ceda7c36271e4dc0544b24d08ebfe7275..6197b5ffed85f41d4b91a04436fd77ecce800f67 100644 --- a/layouts/persons/list.html +++ b/layouts/persons/list.html @@ -33,7 +33,10 @@ <div class="container"> {{- if not $is_organigram_present -}} {{ partial "persons/taxonomies.html" . }} - {{ partial "persons/list.html" . }} + {{ $persons := .Pages.ByParam "last_name" }} + {{ $persons = (.Paginate $persons).Pages }} + {{ partial "persons/list.html" (dict "persons" $persons) }} + {{ partial "commons/pagination.html" . }} {{- end -}} </div>