109 lines
3.8 KiB
HTML
109 lines
3.8 KiB
HTML
{{ define "main" }}
|
||
<main>
|
||
<article>
|
||
{{ partial "header.html" . -}}
|
||
{{- $isLiens := eq .Parent.Title "Liens intéressants" -}}
|
||
{{- $mtop := cond $isLiens "0" "2rem" -}}
|
||
|
||
{{- $coverPath := .Params.cover -}}
|
||
{{- $img := false -}}
|
||
{{- $coverData := dict -}}
|
||
{{- if $coverPath -}}
|
||
{{- $img = .Resources.GetMatch $coverPath -}}
|
||
{{- if $img }}
|
||
{{- $mtop = cond $isLiens "0" "100vh" -}}
|
||
|
||
{{/* Traitement YAML associé à l’image de couverture */}}
|
||
{{- $basename := path.Base $coverPath -}}
|
||
{{- $filename := replaceRE "\\.[^.]+$" "" $basename -}}
|
||
{{- $yamlPath := printf "data/images/%s.yaml" $filename -}}
|
||
{{- $yamlFile := .Resources.GetMatch $yamlPath -}}
|
||
|
||
{{- with $yamlFile }}
|
||
{{- $yamlContent := .Content -}}
|
||
{{- $coverData = $yamlContent | transform.Unmarshal -}}
|
||
{{- end }}
|
||
|
||
<div class="article-hero {{ if $isLiens }}blurred-cover{{ end }}"
|
||
style="background-image: url('{{ $img.RelPermalink }}');">
|
||
{{ if $coverData.attribution }}
|
||
<div class="image-attribution">
|
||
<span>Attribution :</span>
|
||
{{ $coverData.attribution | markdownify }}
|
||
</div>
|
||
{{ end }}
|
||
</div>
|
||
<div id="article-backdrop"></div>
|
||
{{- end }}
|
||
{{- end }}
|
||
|
||
{{- $context := . -}}
|
||
{{- $context.Scratch.Set "paginationPosition" "down" -}}
|
||
|
||
<section class="articles-list">
|
||
{{- partial "dossier-summary" . -}}
|
||
</section>
|
||
|
||
<div class="article-content numbered-headings" style="margin-top: {{ $mtop }}">
|
||
{{- if $isLiens }}
|
||
{{- with .Params.links }}
|
||
<div class="external-links-block" style="margin-top: 2rem; text-align: center;">
|
||
{{- range . }}
|
||
{{- if eq .name "Page d'origine" }}
|
||
<a class="external-link" href="{{ .url }}" target="_blank" rel="noopener">
|
||
Visiter le site
|
||
</a>
|
||
{{- else if eq .name "Lien archivé" }}
|
||
<a class="archive-link" href="{{ .url }}" target="_blank" rel="noopener">
|
||
Voir sur archive.org
|
||
</a>
|
||
{{- end }}
|
||
{{- end }}
|
||
</div>
|
||
{{- end }}
|
||
{{- end }}
|
||
{{ .Content }}
|
||
</div>
|
||
|
||
{{ if and $img (gt (len $coverData) 0) }}
|
||
<aside class="image-info-block" aria-labelledby="image-info-title">
|
||
<h2>Image d'en-tête</h2>
|
||
{{ with $coverData.title }}
|
||
<h3 id="image-info-title">{{ . | markdownify }}</h3>
|
||
{{ end }}
|
||
|
||
{{ $resized := $img.Resize "800x" }}
|
||
<figure class="image-inline">
|
||
<a href="{{ $img.RelPermalink }}" title="Cliquez pour agrandir l'image">
|
||
<img src="{{ $resized.RelPermalink }}" alt="{{ $coverData.title }}" title="{{ $coverData.title }}" />
|
||
</a>
|
||
</figure>
|
||
|
||
{{ with $coverData.description }}
|
||
<section class="image-description">
|
||
<p>{{ .| markdownify }}</p>
|
||
</section>
|
||
{{ end }}
|
||
|
||
{{ with $coverData.prompt }}
|
||
<section class="image-prompt">
|
||
<h3>Prompt de génération IA</h3>
|
||
<blockquote>{{ . }}</blockquote>
|
||
</section>
|
||
{{ end }}
|
||
|
||
{{ with $coverData.attribution }}
|
||
<footer>
|
||
<p><strong>Attribution :</strong> {{ . | markdownify }}</p>
|
||
</footer>
|
||
{{ end }}
|
||
</aside>
|
||
{{ end }}
|
||
|
||
{{- $context.Scratch.Set "paginationPosition" "up" -}}
|
||
<section class="articles-list">
|
||
{{- partial "dossier-summary" . -}}
|
||
</section>
|
||
</article>
|
||
</main>
|
||
{{ end }} |