From 62aa0e0ad4d9035d7e050942f055aa486d00fd98 Mon Sep 17 00:00:00 2001 From: Richard Dern Date: Sat, 5 Apr 2025 21:01:36 +0200 Subject: [PATCH] Fixed displaying content after the article tag --- themes/default/assets/css/list.css | 2 + themes/default/layouts/_default/list.html | 74 +++++++++++++++++------ 2 files changed, 58 insertions(+), 18 deletions(-) diff --git a/themes/default/assets/css/list.css b/themes/default/assets/css/list.css index fc76b41d..35a3a24f 100644 --- a/themes/default/assets/css/list.css +++ b/themes/default/assets/css/list.css @@ -1,5 +1,7 @@ .articles-list { padding: 1rem; + position: relative; + z-index: 2; } .articles-grid { diff --git a/themes/default/layouts/_default/list.html b/themes/default/layouts/_default/list.html index 77a0332c..c270495b 100644 --- a/themes/default/layouts/_default/list.html +++ b/themes/default/layouts/_default/list.html @@ -1,22 +1,60 @@ {{ define "main" }} +{{- $bundle := . -}} +{{- if .IsSection }} +{{- $bundle = site.GetPage .Path -}} {{/* Récupère la section active proprement */}} +{{- end }} +
{{- partial "header.html" . }} - {{- with .Content }} -
-
- {{ . }} -
-
- {{- end }} -
- {{ $pages := .Pages -}} - {{- $paginator := .Paginate $pages.ByDate.Reverse 12 -}} - {{- $context := . -}} - {{- $context.Scratch.Set "paginationPosition" "up" -}} - {{- $context.Scratch.Set "paginator" $paginator -}} - {{ partial "articles-list.html" (dict "Pages" $paginator.Pages "Context" $context) -}} - {{ partial "pagination.html" $context -}} -
-
-{{ end }} +
+ {{- $coverPath := $bundle.Params.cover -}} + {{- $mtop := "2rem" -}} + {{- $img := false -}} + {{- $coverData := dict -}} + + {{- if $coverPath -}} + {{- $img = $bundle.Resources.GetMatch $coverPath -}} + {{- if $img }} + {{- $mtop = "100vh" -}} + + {{/* Traitement YAML compagnon de l’image */}} + {{- $basename := path.Base $coverPath -}} + {{- $filename := replaceRE "\\.[^.]+$" "" $basename -}} + {{- $yamlPath := printf "data/images/%s.yaml" $filename -}} + {{- $yamlFile := $bundle.Resources.GetMatch $yamlPath -}} + + {{- with $yamlFile }} + {{- $coverData = .Content | transform.Unmarshal -}} + {{- end }} + +
+ {{- if $coverData.attribution }} +
+ Attribution : + {{ $coverData.attribution | markdownify }} +
+ {{- end }} +
+
+ {{- end }} + {{- end }} + + {{- if $bundle.Content }} +
+ {{ $bundle.Content }} +
+ {{- end }} +
+ +
+ {{- $pages := .Pages -}} + {{- $paginator := .Paginate $pages.ByDate.Reverse 12 -}} + {{- $context := . -}} + {{- $context.Scratch.Set "paginationPosition" "up" -}} + {{- $context.Scratch.Set "paginator" $paginator -}} + {{- partial "articles-list.html" (dict "Pages" $paginator.Pages "Context" $context) -}} + {{- partial "pagination.html" $context -}} +
+ +{{ end }} \ No newline at end of file