feat: Modification des images dans les actualités
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-04-02 23:18:38 +02:00
parent dc26afe2cb
commit 99722d5857
4 changed files with 43 additions and 4 deletions

View File

@ -1,5 +1,17 @@
{{ define "main" }}
<div class="container">
{{ $headless := site.GetPage "/" }}
{{ $imageSize := "1208x459 Center webp" }}
{{ $image := default ($headless.Resources.GetMatch "**.jpg") (.Resources.GetMatch (default "**.jpg" .Params.image)) }}
{{ if $image }}
{{ $resized := $image.Fill $imageSize }}
<img
class="hero no-print"
src="{{ $resized.RelPermalink }}"
alt="{{ or .Params.image_ .Params.image_credit }}"
title="{{ or .Params.image_ .Params.image_credit }}"
/>
{{ end }}
<h1>{{ .RenderString .Title }}</h1>
<div class="container news md">
<small>