🐛 Don't lazy load prominent images

Fixes: #591
pull/648/head
James Panther 2023-09-10 10:38:54 +10:00
parent 743104db52
commit f34a827cea
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
4 changed files with 5 additions and 16 deletions

View File

@ -23,8 +23,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Fixed ### Fixed
- TypeError is output to console when viewing leaf pages ([#596](https://github.com/jpanther/congo/pull/596)) - Prominent images in content and site layout are lazy loaded ([#591](https://github.com/jpanther/congo/issues/591))
- URL to Congo project in footer used deprecated git.io short link ([#605](https://github.com/jpanther/congo/pull/605)) - TypeError is output to console when viewing leaf pages ([#596](https://github.com/jpanther/congo/issues/596))
- URL to Congo project in footer used deprecated git.io short link ([#605](https://github.com/jpanther/congo/issues/605))
- Various typos in the docs and example site ([#608](https://github.com/jpanther/congo/pull/608), [#609](https://github.com/jpanther/congo/pull/609), [#613](https://github.com/jpanther/congo/pull/613)) - Various typos in the docs and example site ([#608](https://github.com/jpanther/congo/pull/608), [#609](https://github.com/jpanther/congo/pull/609), [#613](https://github.com/jpanther/congo/pull/613))
- Incorrect `render` value is used in the 'external' archetype ([#630](https://github.com/jpanther/congo/pull/630)) - Incorrect `render` value is used in the 'external' archetype ([#630](https://github.com/jpanther/congo/pull/630))

View File

@ -31,9 +31,6 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
alt="{{ $.Params.featureAlt | default $.Params.coverAlt | default "" }}" alt="{{ $.Params.featureAlt | default $.Params.coverAlt | default "" }}"
{{ if $.Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/> />
{{ with $.Params.coverCaption }} {{ with $.Params.coverCaption }}
<figcaption class="mb-6 -mt-3 text-center">{{ . | markdownify }}</figcaption> <figcaption class="mb-6 -mt-3 text-center">{{ . | markdownify }}</figcaption>

View File

@ -3,20 +3,17 @@
h-full h-full
{{ end }} flex flex-col items-center justify-center text-center" {{ end }} flex flex-col items-center justify-center text-center"
> >
<header class="flex flex-col items-center mb-3"> <header class="mb-3 flex flex-col items-center">
{{ with .Site.Author.image }} {{ with .Site.Author.image }}
{{ $authorImage := resources.Get . }} {{ $authorImage := resources.Get . }}
{{ if $authorImage }} {{ if $authorImage }}
{{ $authorImage := $authorImage.Fill "288x288 Center" }} {{ $authorImage := $authorImage.Fill "288x288 Center" }}
<img <img
class="mb-2 rounded-full h-36 w-36" class="mb-2 h-36 w-36 rounded-full"
width="144" width="144"
height="144" height="144"
alt="{{ $.Site.Author.name | default "Author" }}" alt="{{ $.Site.Author.name | default "Author" }}"
src="{{ $authorImage.RelPermalink }}" src="{{ $authorImage.RelPermalink }}"
{{ if $.Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/> />
{{ end }} {{ end }}
{{ end }} {{ end }}

View File

@ -9,9 +9,6 @@
height="{{ div $logo.Height 2 }}" height="{{ div $logo.Height 2 }}"
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left{{ if $logo_dark }} hidden dark:flex{{ end }}" class="max-h-[10rem] max-w-[10rem] object-scale-down object-left{{ if $logo_dark }} hidden dark:flex{{ end }}"
alt="{{ .Site.Title }}" alt="{{ .Site.Title }}"
{{ if .Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/> />
{{- if $logo_dark }} {{- if $logo_dark }}
<img <img
@ -20,9 +17,6 @@
height="{{ div $logo_dark.Height 2 }}" height="{{ div $logo_dark.Height 2 }}"
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left dark:hidden" class="max-h-[10rem] max-w-[10rem] object-scale-down object-left dark:hidden"
alt="{{ .Site.Title }}" alt="{{ .Site.Title }}"
{{ if .Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/> />
{{- end}} {{- end}}
</a> </a>