1

Introduction du nouveau thème

This commit is contained in:
2025-10-11 00:36:18 +02:00
parent fa5ba208ed
commit 2653b0fa01
112 changed files with 1590 additions and 2766 deletions

View File

@@ -0,0 +1,51 @@
<a href="{{ .RelPermalink }}" class="card panel panel-hero">
{{ $page := . -}}
{{- $coverPath := .Params.cover -}}
{{- $img := false -}}
{{- if $coverPath -}}
{{- if strings.HasSuffix $coverPath ".yaml" -}}
{{- $coverAbsPath := printf "%s%s" $page.File.Dir $coverPath -}}
{{- $coverRaw := readFile $coverAbsPath -}}
{{- $coverData := $coverRaw | transform.Unmarshal -}}
{{- with $coverData.file -}}
{{- $img = $page.Resources.GetMatch . -}}
{{- end -}}
{{- else -}}
{{- $img = $page.Resources.GetMatch $coverPath -}}
{{- end -}}
{{- end -}}
{{- if $img -}}
{{- with $img -}}
{{- $resized := .Fill "450x220" -}}
<div class="card-image" style="background-image: url({{ $resized.RelPermalink }});"></div>
{{ end -}}
{{ else }}<div class="card-image"></div>
{{ end -}}
<div class="card-content">
<h3>{{ .Title }}</h3>
{{- if not $page.IsSection -}}
{{- with $page.Date -}}
<time datetime="{{ . }}">{{ . | time.Format ":date_long" }}</time>
{{- end -}}
{{- end -}}
<div class="card-meta">
{{ $section := "" -}}
{{- with .Parent -}}
{{- $sectionPath := path.Base .File.Dir -}}
{{- $section = $sectionPath -}}
{{- end -}}
<span class="section section-{{ $section }}">{{ .Parent.LinkTitle }}</span>
<span class="reading-time">
{{ if .IsSection -}}
{{- $count := len .Pages -}}
{{- $label := cond (eq $count 1) "article" "articles" -}}
{{- $count }} {{ $label -}}
{{- else -}}
{{- if ge .ReadingTime 5 -}}
{{- .ReadingTime }} min de lecture
{{- end -}}
{{- end }}
</span>
</div>
</div>
</a>