feat: Modification des tailles des images et de l'affichage de la vignette mise en avant
This commit is contained in:
parent
36f1915d86
commit
6cc65c1ff2
|
@ -28,11 +28,14 @@ $size-news: 100px
|
||||||
width: $size-la-une
|
width: $size-la-une
|
||||||
height: $size-la-une
|
height: $size-la-une
|
||||||
@media screen and (max-width: $size-sm)
|
@media screen and (max-width: $size-sm)
|
||||||
|
background: white
|
||||||
width: 100%
|
width: 100%
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
margin: 0
|
margin: 0
|
||||||
img
|
img
|
||||||
width: 100%
|
width: auto
|
||||||
|
margin: 0 auto
|
||||||
|
max-height: 100%
|
||||||
.details
|
.details
|
||||||
padding: 20px
|
padding: 20px
|
||||||
background: var(--color-grey)
|
background: var(--color-grey)
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
{{ $height := 534 }}
|
{{ $height := 534 }}
|
||||||
{{ $image := default ($headless.Resources.GetMatch "**.jpg") (.Resources.GetMatch (default "**.jpg" .Params.image)) }}
|
{{ $image := default ($headless.Resources.GetMatch "**.jpg") (.Resources.GetMatch (default "**.jpg" .Params.image)) }}
|
||||||
{{ if $image }}
|
{{ if $image }}
|
||||||
{{ if and (ge $image.Width $widthOriginal) (ge $image.Height $heightOriginal) }}
|
{{ if and (ge $image.Width $widthOriginal) (ge $image.Height $heightOriginal) }}
|
||||||
{{ $image = $image.Process (printf "fill %dx%d Center webp" $width $height) }}
|
{{ $image = $image.Process (printf "fill %dx%d Center webp" $width $height) }}
|
||||||
{{ else if gt $image.Height $height }}
|
{{ else if gt $image.Height $height }}
|
||||||
{{ $image = $image.Process (printf "resize x%d webp" $height) }}
|
{{ $image = $image.Process (printf "resize x%d webp" $height) }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $image = $image.Process "webp" }}
|
{{ $image = $image.Process "webp" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<img
|
<img
|
||||||
class="hero no-print"
|
class="hero no-print"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{ $isBig := default false (.Scratch.Get "big") }}
|
{{ $isBig := default false (.Scratch.Get "big") }}
|
||||||
{{ $title := .RenderString .Title }}
|
{{ $title := .RenderString .Title }}
|
||||||
{{ $titleWithoutHTML := $title | plainify }}
|
{{ $titleWithoutHTML := $title | plainify }}
|
||||||
{{ $pictureSize := cond $isBig "528x528 Center webp" "100x100 Center webp" }}
|
{{ $pictureSize := cond $isBig "440x440 Center webp" "200x200 Center webp" }}
|
||||||
{{ $truncateSize := cond $isBig 180 90}}
|
{{ $truncateSize := cond $isBig 180 90}}
|
||||||
<div class="post{{ if $isBig }} big{{ end }}">
|
<div class="post{{ if $isBig }} big{{ end }}">
|
||||||
<div class="picture">
|
<div class="picture">
|
||||||
|
|
Loading…
Reference in New Issue