1

Amélioration de l'apparence de l'image de couverture en mode portrait

This commit is contained in:
2026-04-06 22:46:44 +02:00
parent 341d1d30f8
commit b34c6acc42
3 changed files with 8 additions and 7 deletions

View File

@@ -24,6 +24,8 @@
{{- $result = $image.Crop $options -}} {{- $result = $image.Crop $options -}}
{{- else if eq $action "Resize" -}} {{- else if eq $action "Resize" -}}
{{- $result = $image.Resize $options -}} {{- $result = $image.Resize $options -}}
{{- else if eq $action "Fit" -}}
{{- $result = $image.Fit $options -}}
{{- else -}} {{- else -}}
{{- errorf "media/process-image.html: unsupported image action %q for %q" $action $image.Name -}} {{- errorf "media/process-image.html: unsupported image action %q for %q" $action $image.Name -}}
{{- end -}} {{- end -}}

View File

@@ -56,6 +56,8 @@
.article-header .article-cover { .article-header .article-cover {
margin-top: 0; margin-top: 0;
display: flex;
justify-content: flex-end;
} }
.article-header .article-cover > a { .article-header .article-cover > a {
@@ -63,8 +65,9 @@
} }
.article-header .article-cover img { .article-header .article-cover img {
width: 100%; width: auto;
height: auto; height: auto;
max-height: 90vh;
} }
.article-header .article-meta { .article-header .article-meta {

View File

@@ -106,14 +106,10 @@
{{- if $coverImage -}} {{- if $coverImage -}}
{{- $coverDisplay = $coverImage -}} {{- $coverDisplay = $coverImage -}}
{{- if ne $coverDisplay.MediaType.SubType "svg" -}} {{- if ne $coverDisplay.MediaType.SubType "svg" -}}
{{- $coverWidth := $coverDisplay.Width -}}
{{- if gt $coverDisplay.Width 1480 -}}
{{- $coverWidth = 1480 -}}
{{- end -}}
{{- $coverDisplay = partial "media/process-image.html" (dict {{- $coverDisplay = partial "media/process-image.html" (dict
"image" $coverImage "image" $coverImage
"action" "Resize" "action" "Fit"
"spec" (printf "%dx" $coverWidth) "spec" "1480x900"
) -}} ) -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}