Fixed displaying content after the article tag
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
.articles-list {
|
.articles-list {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.articles-grid {
|
.articles-grid {
|
||||||
|
|||||||
@@ -1,22 +1,60 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
{{- $bundle := . -}}
|
||||||
|
{{- if .IsSection }}
|
||||||
|
{{- $bundle = site.GetPage .Path -}} {{/* Récupère la section active proprement */}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
{{- partial "header.html" . }}
|
{{- partial "header.html" . }}
|
||||||
{{- with .Content }}
|
|
||||||
<article>
|
<article>
|
||||||
<div class="article-content">
|
{{- $coverPath := $bundle.Params.cover -}}
|
||||||
{{ . }}
|
{{- $mtop := "2rem" -}}
|
||||||
</div>
|
{{- $img := false -}}
|
||||||
</article>
|
{{- $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 }}
|
{{- end }}
|
||||||
<section class="articles-list">
|
|
||||||
{{ $pages := .Pages -}}
|
<div class="article-hero" style="background-image: url('{{ $img.RelPermalink }}');">
|
||||||
{{- $paginator := .Paginate $pages.ByDate.Reverse 12 -}}
|
{{- if $coverData.attribution }}
|
||||||
{{- $context := . -}}
|
<div class="image-attribution">
|
||||||
{{- $context.Scratch.Set "paginationPosition" "up" -}}
|
<span>Attribution :</span>
|
||||||
{{- $context.Scratch.Set "paginator" $paginator -}}
|
{{ $coverData.attribution | markdownify }}
|
||||||
{{ partial "articles-list.html" (dict "Pages" $paginator.Pages "Context" $context) -}}
|
</div>
|
||||||
{{ partial "pagination.html" $context -}}
|
{{- end }}
|
||||||
</section>
|
</div>
|
||||||
|
<div id="article-backdrop"></div>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if $bundle.Content }}
|
||||||
|
<div class="article-content" style="margin-top: {{ $mtop }}">
|
||||||
|
{{ $bundle.Content }}
|
||||||
|
</div>
|
||||||
|
{{- end }}
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<section class="articles-list">
|
||||||
|
{{- $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 -}}
|
||||||
|
</section>
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user