diff options
| author | tdro <tdro@noreply.example.com> | 2022-06-24 08:39:43 -0400 |
|---|---|---|
| committer | tdro <tdro@noreply.example.com> | 2022-06-24 08:39:43 -0400 |
| commit | 23baef43fb1c150011dc05f8fc57e040f0241232 (patch) | |
| tree | b928bf143682b0cf470d2dc6b831d5a13ba72bf6 | |
| parent | 75d98814e033abd8ae7b82a536b92a4cb6ef3352 (diff) | |
| download | canory-23baef43fb1c150011dc05f8fc57e040f0241232.tar.gz canory-23baef43fb1c150011dc05f8fc57e040f0241232.tar.bz2 canory-23baef43fb1c150011dc05f8fc57e040f0241232.zip | |
themes/default/layouts/partials/gallery-walk: Don't implicitly default to webp
| -rw-r--r-- | assets/css/default.css | 8 | ||||
| -rw-r--r-- | themes/default/layouts/partials/gallery-walk.html | 20 |
2 files changed, 18 insertions, 10 deletions
diff --git a/assets/css/default.css b/assets/css/default.css index ecd8257..adca442 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -1101,14 +1101,18 @@ gallery-images aside { position: relative; } -gallery-images img { - border-radius: 0; +gallery-images picture { + display: flex; flex-basis: 33.33%; flex-grow: 1; height: 6rem; width: 33.333%; } +gallery-images picture img { + border-radius: 0; +} + gallery-overlay { background-color: transparent; border-radius: 0.5rem; diff --git a/themes/default/layouts/partials/gallery-walk.html b/themes/default/layouts/partials/gallery-walk.html index 3eacd43..71897b6 100644 --- a/themes/default/layouts/partials/gallery-walk.html +++ b/themes/default/layouts/partials/gallery-walk.html @@ -66,14 +66,18 @@ {{- range first 6 $files }} {{- if not .IsDir }} {{- with $image := resources.Get .Path -}} - {{- $image = (.Content | resources.FromString (print (partial "function-paths-media.html") "/" $author "/gallery-walker_" (path.Base .))).Fit $dimensions }} - <img - alt="{{- .Name }}" - title="{{- .Name }}" - width="{{ $image.Width }}" - height="{{ $image.Height }}" - src="{{ $image.RelPermalink }}" - /> + {{- $image = (.Content | resources.FromString (print (partial "function-paths-media.html") "/" $author "/gallery-walker_" (path.Base .))).Fit (print $dimensions " webp") }} + <picture> + <source srcset="{{- $image.RelPermalink -}}" type="image/webp" /> + {{- $image = (.Content | resources.FromString (print (partial "function-paths-media.html") "/" $author "/gallery-walker_" (path.Base .))).Fit (print $dimensions " png") }} + <img + alt="{{- .Name }}" + title="{{- .Name }}" + width="{{ $image.Width }}" + height="{{ $image.Height }}" + src="{{ $image.RelPermalink }}" + /> + </picture> {{ end }} {{- end -}} {{- end -}} |
