diff --git a/src/layouts/_default/home.html b/src/layouts/_default/home.html index b27e64b80..2fd72160f 100644 --- a/src/layouts/_default/home.html +++ b/src/layouts/_default/home.html @@ -3,7 +3,7 @@
{{ $paginator := .Paginate (where site.RegularPages "Type" "posts") -}} {{- range $i, $page := $paginator.Pages -}} - {{- /* Don't lazyload the first video in each page */ -}} + {{- /* Don't lazyload the first asset in each page (video, banner etc) */ -}} {{- $lazyload := cond (eq $i 0) false true -}}
@@ -18,7 +18,7 @@

{{- end }} {{ if .Page.Params.banner -}} - {{- partial "banner" (dict "context" .) -}} + {{- partial "banner" (dict "context" . "lazyload" $lazyload) -}} {{- end }} {{ .Content }} diff --git a/src/layouts/partials/banner.html b/src/layouts/partials/banner.html index 5b8b5abea..f70e6a84c 100644 --- a/src/layouts/partials/banner.html +++ b/src/layouts/partials/banner.html @@ -3,5 +3,6 @@ {{- $src := .context.Page.Params.banner -}} {{- $config := imageConfig (path.Join "/src/static" $src) -}} {{- $classes := "d-block img-fluid rounded-3 mb-4" -}} +{{- $lazyload := .lazyload -}} - +