fix: add alt to image in articles

This commit is contained in:
Matthieu Bessat 2024-03-31 17:55:04 +02:00
parent b95c85c73b
commit 53c41662bd
2 changed files with 2 additions and 5 deletions

View file

@ -13,7 +13,7 @@
{{ if $featuredImage }} {{ if $featuredImage }}
{{ $featuredImage = $featuredImage.Resize "600x" }} {{ $featuredImage = $featuredImage.Resize "600x" }}
<figure> <figure>
<img alt="" src="{{ $featuredImage.RelPermalink }}" /> <img alt="{{ with .Params.featured_image.alt }}{{ . }}{{ end }}" src="{{ $featuredImage.RelPermalink }}" />
{{ with .Params.featured_image.caption }} {{ with .Params.featured_image.caption }}
<figcaption>{{ . }}</figcaption> <figcaption>{{ . }}</figcaption>
{{ end }} {{ end }}

View file

@ -19,10 +19,7 @@
{{ end }} {{ end }}
{{ $featuredImage := $featuredImage.Fill "465x348 Center" }} {{ $featuredImage := $featuredImage.Fill "465x348 Center" }}
<figure> <figure>
<img alt="" src="{{ $featuredImage.RelPermalink }}" /> <img alt="{{ with .Params.featured_image.alt }}{{ . }}{{ end }}" src="{{ $featuredImage.RelPermalink }}" />
{{ with .Params.featured_image.caption }}
<figcaption>{{ . }}</figcaption>
{{ end }}
</figure> </figure>
</a> </a>
<div class="news-item__content"> <div class="news-item__content">