website/layouts/_default/single.html
Matthieu Bessat ae2accd6db
All checks were successful
Deploy workflow / deploy (push) Successful in 29s
fix: add alt to image in articles
2024-03-31 17:55:04 +02:00

32 lines
1 KiB
HTML

{{ define "main" }}
<main class="page-container">
<article class="article">
<h1>{{ .Title }}</h1>
{{ with .Date }}
<div>Publié le <b><time>{{ . | time.Format ":date_full" }}</time></b></div>
{{ end }}
{{ if .Params.featured_image }}
{{ $featuredImage := .Resources.GetMatch (.Params.featured_image.src | safeURL) }}
{{ if $featuredImage }}
{{ $featuredImage = $featuredImage.Resize "600x" }}
<figure>
<img alt="{{ with .Params.featured_image.alt }}{{ . }}{{ end }}" src="{{ $featuredImage.RelPermalink }}" />
{{ with .Params.featured_image.caption }}
<figcaption>{{ . }}</figcaption>
{{ end }}
</figure>
{{ end }}
{{ end }}
{{ range .Params.tags }}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
<div>
{{ .Content }}
</div>
</article>
</main>
{{ end }}