Skip to content

Commit

Permalink
Render smaller images
Browse files Browse the repository at this point in the history
  • Loading branch information
pindab0ter committed Oct 21, 2023
1 parent bcfd15c commit d92f0ad
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 31 deletions.
2 changes: 1 addition & 1 deletion layouts/contact/single.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "main" }}
<main class="bg-beige lg:py-16">
{{- partial "contact-form.html" (dict "showPictureMobile" true) -}}
{{- partial "contact-form.html" -}}
</main>
{{ end }}
2 changes: 1 addition & 1 deletion layouts/faq/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<main>
<div class="bg-beige">
<div class="mx-auto max-w-screen-xl lg:grid lg:grid-cols-2">
{{ with (resources.Get "photos/yuki-ginny-balcony.png").Process "webp" }}
{{ with (resources.Get "photos/yuki-ginny-balcony.png").Process "resize 640x webp" }}
<img
src="{{ .RelPermalink }}"
alt="Yuki en Ginny op het balkon"
Expand Down
6 changes: 3 additions & 3 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h1 class="mb-8 text-start">Over ons</h1>
<div class="grid grid-cols-1 lg:grid-cols-3">
<div
class="bg-[position-x:40%] aspect-video bg-cover bg-right lg:aspect-square"
{{ with (resources.Get "photos/yuki-ginny-balcony.png").Process "webp" }}
{{ with (resources.Get "photos/yuki-ginny-balcony.png").Process "resize 427x webp" }}
style="background-image: url('{{ .RelPermalink }}');
background-position-x: 40%;"
{{ end }}
Expand All @@ -67,7 +67,7 @@ <h1 class="mb-8 text-start">Over ons</h1>

<div
class="aspect-video bg-cover lg:aspect-square"
{{ with (resources.Get "photos/ginny-kitten.jpg").Process "webp" }}
{{ with (resources.Get "photos/ginny-kitten.jpg").Process "resize 427x webp" }}
style="background-image: url('{{ .RelPermalink }}');"
{{ end }}
>
Expand All @@ -84,7 +84,7 @@ <h1 class="mb-8 text-start">Over ons</h1>

<div
class="aspect-video bg-cover bg-[center_top_50%] lg:aspect-square"
{{ with (resources.Get "photos/yuki-ginny-together-on-bed.jpg").Process "webp" }}
{{ with (resources.Get "photos/yuki-ginny-together-on-bed.jpg").Process "resize 427x webp" }}
style="background-image: url('{{ .RelPermalink }}');"
{{ end }}
>
Expand Down
2 changes: 1 addition & 1 deletion layouts/kittenbeleid/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<main>
<div class="bg-beige">
<div class="mx-auto max-w-screen-xl lg:grid lg:grid-cols-2">
{{ with (resources.Get "photos/avatar-kitten-portret.jpg").Process "webp" }}
{{ with (resources.Get "photos/avatar-kitten-portret.jpg").Process "resize 640x webp" }}
<img
src="{{ .RelPermalink }}"
alt="Jonge Ginny"
Expand Down
2 changes: 1 addition & 1 deletion layouts/kittens/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h1 class="mt-0">De kittens van Hamana</h1>
<div class="flex flex-col">
{{ with .Resources.Get "photo" }}
<img
src="{{ (.Process "webp drawing").RelPermalink }}"
src="{{ (.Process "resize 512x webp drawing").RelPermalink }}"
alt="{{ .Title }}"
class="mx-auto mb-8 mt-16 h-full w-full object-cover lg:max-w-lg"
/>
Expand Down
4 changes: 2 additions & 2 deletions layouts/nieuws/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h1>Nieuws</h1>
<div class="bg-white lg:hidden">
{{ with .Resources.Get "photo" }}
<img
src="{{ (.Process "webp").RelPermalink }}"
src="{{ (.Process "resize 576x webp").RelPermalink }}"
alt="{{ .Title }}"
class="h-full w-full object-cover"
/>
Expand Down Expand Up @@ -46,7 +46,7 @@ <h2 class="text-center">

{{ with .Resources.Get "photo" }}
<img
src="{{ .RelPermalink }}"
src="{{ (.Process "resize 576x webp").RelPermalink }}"
alt="{{ .Title }}"
class="h-full w-full object-cover"
/>
Expand Down
6 changes: 3 additions & 3 deletions layouts/onze-poezen/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<main class="bg-beige lg:pb-16">
<div class="flex aspect-square h-48 w-full text-white lg:aspect-auto">
<div class="absolute aspect-auto h-48 w-full">
{{ with (resources.Get "photos/yuki-ginny-close-up.jpg").Process "webp" }}
{{ with (resources.Get "photos/yuki-ginny-close-up.jpg").Process "resize 1024x webp" }}
<img
src="{{ .RelPermalink }}"
alt="Yuki and Ginny close up"
Expand All @@ -24,7 +24,7 @@ <h1 class="text-white">Onze poezen</h1>
<div class="max-w-screen-xl lg:grid lg:grid-cols-2">
{{ range sort .Paginator.Pages.Reverse }}
<div class="lg:hidden">
{{ with (.Resources.Get "photo").Process "webp" }}
{{ with (.Resources.Get "photo").Process "resize 576x webp" }}
<img
src="{{ .RelPermalink }}"
alt="{{ .Title }}"
Expand All @@ -43,7 +43,7 @@ <h2 class="mt-0 text-center">{{ .Title }}</h2>

<div class="mx-8 mb-10 hidden h-full bg-white lg:block">
<div>
{{ with (.Resources.Get "photo").Process "webp" }}
{{ with (.Resources.Get "photo").Process "resize 576x webp" }}
<img
src="{{ .RelPermalink }}"
alt="{{ .Title }}"
Expand Down
30 changes: 11 additions & 19 deletions layouts/partials/contact-form.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
<div class="grid grid-cols-1 bg-white lg:grid-cols-2">
{{ if .showPictureMobile }}
{{ with (resources.Get "photos/yuki-ginny-balcony-looking-outside-together.jpg").Process "webp" }}
<div class="mb-16 mt-8 flex content-center bg-white lg:hidden">
<img
src="{{ .RelPermalink }}"
alt="Yuki and Ginny looking outside from the balcony together"
class="w-100 aspect-[16/9] object-cover"
style="object-position: 100% 30%"
/>
</div>
{{ end }}
{{ with (resources.Get "photos/yuki-ginny-balcony-looking-outside-together.jpg").Process "webp" }}
<div class="mb-16 mt-8 flex content-center bg-white lg:hidden">
<img
src="{{ .RelPermalink }}"
alt="Yuki and Ginny looking outside from the balcony together"
class="w-100 aspect-[16/9] object-cover"
style="object-position: 100% 30%"
/>
</div>
{{ end }}


<div
class="{{ if (not .showPictureMobile) }}
py-24
{{ else }}
pb-24
{{ end }}lg:px-10 lg:px-20"
>
<div class=" pb-24 lg:px-10 lg:px-20">
<h1 class="mt-0 text-center">Contact</h1>
<div class="flex justify-center">
<div class="mx-2 h-5 w-5">
Expand Down Expand Up @@ -87,7 +79,7 @@ <h1 class="mt-0 text-center">Contact</h1>
</div>

<div class="hidden content-center bg-white lg:flex">
{{ with (resources.Get "photos/yuki-ginny-balcony-looking-outside-together.jpg").Process "webp" }}
{{ with (resources.Get "photos/yuki-ginny-balcony-looking-outside-together.jpg").Process "resize 640x fit webp" }}
<img
src="{{ .RelPermalink }}"
alt="Yuki and Ginny looking outside from the balcony together"
Expand Down

0 comments on commit d92f0ad

Please sign in to comment.