Bloc "Pour aller plus loin"
This commit is contained in:
@@ -303,52 +303,52 @@ main > article li + li {
|
||||
margin-top: 0.35rem;
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list {
|
||||
--articles-related-flow-gap: 0.78rem;
|
||||
margin-top: var(--space-2);
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol {
|
||||
padding-left: 0;
|
||||
grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: var(--space-4);
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li,
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li + li {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li,
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li + li {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list article {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list article {
|
||||
border-top: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article > header {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article > header {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article > header > a {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article > header > a {
|
||||
display: block;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article > header > a > figure {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article > header > a > figure {
|
||||
margin: 0;
|
||||
min-height: 0;
|
||||
aspect-ratio: 340 / 191;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article > header > a > figure img {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article > header > a > figure img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article > header > p {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article > header > p {
|
||||
margin-top: var(--articles-related-flow-gap);
|
||||
font-size: 0.84rem;
|
||||
line-height: 1.15;
|
||||
@@ -357,17 +357,17 @@ main > article > section.article-asides > section.article-related > nav.articles
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article > header > p > a {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article > header > p > a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
font-family: var(--font-heading);
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article > header > p > a:is(:hover, :focus-visible) {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article > header > p > a:is(:hover, :focus-visible) {
|
||||
color: var(--color-link-hover);
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article > header > h3 {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article > header > h3 {
|
||||
margin-top: var(--articles-related-flow-gap);
|
||||
margin-bottom: 0;
|
||||
padding-top: 0;
|
||||
@@ -380,19 +380,19 @@ main > article > section.article-asides > section.article-related > nav.articles
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article > header > h3::before {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article > header > h3::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article > header:has(> p) > h3 {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article > header:has(> p) > h3 {
|
||||
margin-top: calc(var(--articles-related-flow-gap) * 0.4);
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list article > p:nth-of-type(1) {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list article > p:nth-of-type(1) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list article > p:last-child {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list article > p:last-child {
|
||||
margin-top: var(--articles-related-flow-gap);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@@ -405,23 +405,23 @@ main > article > section.article-asides > section.article-related > nav.articles
|
||||
font-family: var(--font-heading);
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article > a:is(:hover, :focus-visible) > h3,
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article > header > h3 > a:is(:hover, :focus-visible),
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list > ol > li article:has(> header > a:is(:hover, :focus-visible)) > header > h3 > a {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article > a:is(:hover, :focus-visible) > h3,
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article > header > h3 > a:is(:hover, :focus-visible),
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol > li article:has(> header > a:is(:hover, :focus-visible)) > header > h3 > a {
|
||||
color: var(--color-link-hover);
|
||||
text-decoration: underline;
|
||||
text-decoration-thickness: 1px;
|
||||
text-underline-offset: 0.15em;
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list article > p:last-child > a {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list article > p:last-child > a {
|
||||
color: inherit;
|
||||
text-decoration: underline;
|
||||
text-decoration-thickness: 1px;
|
||||
text-underline-offset: 0.15em;
|
||||
}
|
||||
|
||||
main > article > section.article-asides > section.article-related > nav.articles-list article > p:last-child > a:is(:hover, :focus-visible) {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list article > p:last-child > a:is(:hover, :focus-visible) {
|
||||
color: inherit;
|
||||
filter: brightness(1.2);
|
||||
}
|
||||
@@ -1510,6 +1510,10 @@ body:has(> header.article-header) > main > aside.article-toc nav[aria-label="Som
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
body:has(> header.article-header) > main > article > table {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
@@ -1602,6 +1606,10 @@ body:has(> header.article-header) > main > aside.article-toc nav[aria-label="Som
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
main > article > section.article-asides > section.article-page-links > nav.articles-list > ol {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
main > article > figure.chat-message {
|
||||
--chat-bubble-max-width: calc(100% - 1.4rem);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{{- $commentsMarkup := strings.TrimSpace (partial "asides/comments.html" .) -}}
|
||||
{{- $keywordsMarkup := strings.TrimSpace (partial "asides/keywords.html" .) -}}
|
||||
{{- $furtherReadingMarkup := strings.TrimSpace (partial "article-further-reading.html" .) -}}
|
||||
{{- $relatedMarkup := strings.TrimSpace (partial "article-related.html" .) -}}
|
||||
{{- if or (ne $commentsMarkup "") (ne $keywordsMarkup "") (ne $relatedMarkup "") -}}
|
||||
{{- if or (ne $commentsMarkup "") (ne $keywordsMarkup "") (ne $furtherReadingMarkup "") (ne $relatedMarkup "") -}}
|
||||
<section class="article-asides">
|
||||
{{- with $commentsMarkup -}}
|
||||
{{- . | safeHTML -}}
|
||||
@@ -9,6 +10,9 @@
|
||||
{{- with $keywordsMarkup -}}
|
||||
{{- . | safeHTML -}}
|
||||
{{- end -}}
|
||||
{{- with $furtherReadingMarkup -}}
|
||||
{{- . | safeHTML -}}
|
||||
{{- end -}}
|
||||
{{- with $relatedMarkup -}}
|
||||
{{- . | safeHTML -}}
|
||||
{{- end -}}
|
||||
|
||||
10
themes/2026/layouts/_partials/article-further-reading.html
Normal file
10
themes/2026/layouts/_partials/article-further-reading.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{- $items := partial "resolve-pages-from-urls.html" (dict
|
||||
"URLs" .Params.further_reading
|
||||
"CurrentPage" .
|
||||
) -}}
|
||||
{{- partial "article-pages-block.html" (dict
|
||||
"Title" "Pour aller plus loin"
|
||||
"Class" "article-further-reading"
|
||||
"Pages" $items
|
||||
"ShowDossierBeforeTitle" true
|
||||
) -}}
|
||||
27
themes/2026/layouts/_partials/article-pages-block.html
Normal file
27
themes/2026/layouts/_partials/article-pages-block.html
Normal file
@@ -0,0 +1,27 @@
|
||||
{{- $title := "" -}}
|
||||
{{- $class := "" -}}
|
||||
{{- $pages := slice -}}
|
||||
{{- $showDossierBeforeTitle := false -}}
|
||||
{{- if reflect.IsMap . -}}
|
||||
{{- with .Title -}}
|
||||
{{- $title = . -}}
|
||||
{{- end -}}
|
||||
{{- with .Class -}}
|
||||
{{- $class = . -}}
|
||||
{{- end -}}
|
||||
{{- with .Pages -}}
|
||||
{{- $pages = . -}}
|
||||
{{- end -}}
|
||||
{{- if isset . "ShowDossierBeforeTitle" -}}
|
||||
{{- $showDossierBeforeTitle = index . "ShowDossierBeforeTitle" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if and (ne $title "") (gt (len $pages) 0) -}}
|
||||
<section class="article-aside-block article-page-links{{ with $class }} {{ . }}{{ end }}">
|
||||
<h2>{{ $title }}</h2>
|
||||
{{- partial "articles-list.html" (dict
|
||||
"Pages" $pages
|
||||
"ShowDossierBeforeTitle" $showDossierBeforeTitle
|
||||
) -}}
|
||||
</section>
|
||||
{{- end -}}
|
||||
@@ -39,13 +39,10 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if gt (len $items) 0 -}}
|
||||
<section class="article-aside-block article-related">
|
||||
<h2>Articles relatifs</h2>
|
||||
{{- partial "articles-list.html" (dict
|
||||
"Pages" $items
|
||||
"ShowDossierBeforeTitle" true
|
||||
) -}}
|
||||
</section>
|
||||
{{- end -}}
|
||||
{{- partial "article-pages-block.html" (dict
|
||||
"Title" "Articles relatifs"
|
||||
"Class" "article-related"
|
||||
"Pages" $items
|
||||
"ShowDossierBeforeTitle" true
|
||||
) -}}
|
||||
{{- end -}}
|
||||
|
||||
62
themes/2026/layouts/_partials/resolve-pages-from-urls.html
Normal file
62
themes/2026/layouts/_partials/resolve-pages-from-urls.html
Normal file
@@ -0,0 +1,62 @@
|
||||
{{- $rawURLs := slice -}}
|
||||
{{- $currentPage := false -}}
|
||||
{{- if reflect.IsMap . -}}
|
||||
{{- with .URLs -}}
|
||||
{{- $rawURLs = . -}}
|
||||
{{- end -}}
|
||||
{{- with .CurrentPage -}}
|
||||
{{- $currentPage = . -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $rawURLs = . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $urls := slice -}}
|
||||
{{- if reflect.IsSlice $rawURLs -}}
|
||||
{{- $urls = $rawURLs -}}
|
||||
{{- else -}}
|
||||
{{- $singleURL := strings.TrimSpace (printf "%v" $rawURLs) -}}
|
||||
{{- if ne $singleURL "" -}}
|
||||
{{- $urls = slice $singleURL -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $pages := slice -}}
|
||||
{{- $seen := dict -}}
|
||||
{{- range $urls -}}
|
||||
{{- $rawURL := strings.TrimSpace (printf "%v" .) -}}
|
||||
{{- if ne $rawURL "" -}}
|
||||
{{- $parsedURL := urls.Parse $rawURL -}}
|
||||
{{- $path := strings.TrimSpace $parsedURL.Path -}}
|
||||
{{- if eq $path "" -}}
|
||||
{{- $path = $rawURL -}}
|
||||
{{- end -}}
|
||||
{{- if not (strings.HasPrefix $path "/") -}}
|
||||
{{- $path = printf "/%s" $path -}}
|
||||
{{- end -}}
|
||||
{{- if not (strings.HasSuffix $path "/") -}}
|
||||
{{- $path = printf "%s/" $path -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $match := false -}}
|
||||
{{- $matches := where site.RegularPages "RelPermalink" "eq" $path -}}
|
||||
{{- if gt (len $matches) 0 -}}
|
||||
{{- $match = index $matches 0 -}}
|
||||
{{- else -}}
|
||||
{{- $matches = where site.RegularPages "Aliases" "intersect" (slice $path) -}}
|
||||
{{- if gt (len $matches) 0 -}}
|
||||
{{- $match = index $matches 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $match -}}
|
||||
{{- $matchedPermalink := $match.RelPermalink -}}
|
||||
{{- $isCurrentPage := and $currentPage (eq $matchedPermalink $currentPage.RelPermalink) -}}
|
||||
{{- if and (not $isCurrentPage) (not (isset $seen $matchedPermalink)) -}}
|
||||
{{- $pages = $pages | append $match -}}
|
||||
{{- $seen = merge $seen (dict $matchedPermalink true) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- return $pages -}}
|
||||
Reference in New Issue
Block a user