Skip to content

Commit 5eaee20

Browse files
committed
improve image transformation for website
1 parent ad967ed commit 5eaee20

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

layouts/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ <h1 class="my-2">{{ .Title | title }}</h1>
3232
{{ $img := $pageScope.Page.Resources.GetMatch .Params.featured_image }}
3333

3434
{{ if ne $img.MediaType.SubType "svg" }}
35-
{{ $img = $img.Fit "250x192" }}
35+
{{ $img = $img.Fit "250x192 webp drawing" }}
3636
{{ end }}
37+
38+
3739

3840
<input type="checkbox" id="featured-{{ $index }}" class="read-more" />
3941
<div class="my-2 mx-5 text-center">

layouts/people/member.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
{{ $resource = resources.Get "images/unk.png" }}
44
{{- end -}}
55

6-
{{- $img := $resource.Fill "250x250 jpeg q90" -}}
6+
{{- $img := $resource.Fill "250x250 webp photo" -}}
7+
78

89
<li class="p-2 align-items-stretch" style="max-width:250px;">
910
<a href="{{ .Permalink }}" class="text-decoration-none">

layouts/people/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{{- if not $resource -}}
2121
{{- $resource = resources.Get "images/unk.png" -}}
2222
{{- end -}}
23-
{{ $img := $resource.Fill "200x200 jpeg q90" }}
23+
{{ $img := $resource.Fill "200x200 webp photo" }}
2424
<img
2525
src="{{ $img.Permalink }}"
2626
width="{{ $img.Width }}"

layouts/projects/list.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<h1>{{ .Title }}</h1>
44

55
{{ range $index, $project := sort .Pages ".Params.date_end" "desc" }}
6-
{{ $img := ( .Resources.GetMatch .Params.featured_image ).Resize "200x" }}
6+
{{ $img := ( .Resources.GetMatch .Params.featured_image ) }}
7+
{{ $img = $img.Resize "200x webp drawing" }}
78
<section class="mt-5">
89
<header class="mb-2">
910
<h2>

0 commit comments

Comments
 (0)