fix header image of blog posts sometimes being clipped
All checks were successful
/ build (pull_request) Successful in 40s

This commit is contained in:
lilly 2026-05-23 15:10:43 +02:00
commit d94b6f74dd
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g
2 changed files with 16 additions and 9 deletions

View file

@ -454,12 +454,17 @@ div.nav-aside {
margin: 15px var(--block-spacing-horizontal); margin: 15px var(--block-spacing-horizontal);
} }
img { .image-container {
padding: 15px var(--block-spacing-horizontal); margin: 0;
width: 100%; padding: 0;
height: 25cqw; display: flex;
object-fit: cover; justify-content: center;
object-position: top;
img {
padding: 15px var(--block-spacing-horizontal);
max-width: 100%;
max-height: 100%;
}
} }
} }

View file

@ -46,8 +46,10 @@
{{- end }} {{- end }}
</div> </div>
{{- if isset .Params "header" }} {{- if isset .Params "header" }}
{{- $img := .Resources.GetMatch .Params.header.image }} <div class="image-container">
<img class="container" src="{{ $img.RelPermalink }}" alt="{{ .Params.header.caption }}" /> {{- $img := .Resources.GetMatch .Params.header.image }}
{{- end }} <img src="{{ $img.RelPermalink }}" alt="{{ .Params.header.caption }}" />
{{- end }}
</div>
</header> </header>
{{- end }} {{- end }}