From 3bc1ca6e614ab8f44f50dbaaca1532c53e229b8d Mon Sep 17 00:00:00 2001 From: Will Faught Date: Mon, 9 Jan 2023 22:08:43 -0800 Subject: [PATCH] Add intrinsic height, width vars --- layouts/partials/paige/img.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/layouts/partials/paige/img.html b/layouts/partials/paige/img.html index 76c5c805..c2828ffa 100644 --- a/layouts/partials/paige/img.html +++ b/layouts/partials/paige/img.html @@ -5,6 +5,8 @@ {{ $fingerprint := .fingerprint | default true }} {{ $height := .height }} {{ $loading := .loading | default "lazy" }} +{{ $maxheight := .maxheight }} +{{ $maxwidth := .maxwidth }} {{ $method := .method }} {{ $options := .options }} {{ $page := .page }} @@ -16,6 +18,9 @@ {{ $title := .title }} {{ $width := .width }} +{{ $intrinsicheight := $height }} +{{ $intrinsicwidth := $width }} + {{ if $raw }} {{ $src = relLangURL $src }} {{ else }} @@ -38,10 +43,12 @@ {{ errorf "invalid method: %q" $method }} {{ end }} {{ end }} + {{ $intrinsicheight = $resource.Height }} + {{ $intrinsicwidth = $resource.Width }} {{ if $fingerprint }} {{ $resource = $resource | fingerprint }} {{ end }} {{ $src = $resource.RelPermalink }} {{ end }} -{{ . }} +{{ . }}