mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 18:15:31 +00:00
fix: previous commit - migrate lazysizes data-src to native src
This commit is contained in:
1 parent
432c6326ee
commit
40e01c083e
5 files changed
+5
-13
No files matched your search
@@ -37,11 +37,9 @@
|
||||
{{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
|
||||
{{ $anchor := $item.Params.image.focal_point | default "Smart" }}
|
||||
{{ with $resource }}
|
||||
{{ $filters := slice (images.GaussianBlur 21) (images.Pixelate 8) }}
|
||||
{{ $image := .Fill (printf "808x455 %s" $anchor) }}
|
||||
{{ $image_lq := (.Fill (printf "808x455 %s q1" $anchor)).Filter $filters }}
|
||||
<a href="{{ $item.RelPermalink }}">
|
||||
<div class="img-hover-zoom"><img src="{{ $image_lq.RelPermalink }}" data-src="{{ $image.RelPermalink }}" class="article-banner" alt="{{ $item.Title }}" loading="lazy"></div>
|
||||
<div class="img-hover-zoom"><img src="{{ $image.RelPermalink }}" class="article-banner" alt="{{ $item.Title }}" loading="lazy"></div>
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
|
||||
@@ -76,11 +76,9 @@
|
||||
<div class="ml-3">
|
||||
{{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
|
||||
{{ with $resource }}
|
||||
{{ $filters := slice (images.GaussianBlur 21) (images.Pixelate 8) }}
|
||||
{{ $image := .Resize "150x" }}
|
||||
{{ $image_lq := (.Resize "150x q1").Filter $filters }}
|
||||
<a href="{{$link}}" {{ $target | safeHTMLAttr }}>
|
||||
<img src="{{ $image_lq.RelPermalink }}" data-src="{{ $image.RelPermalink }}" alt="{{ $item.Title }}" loading="lazy">
|
||||
<img src="{{ $image.RelPermalink }}" alt="{{ $item.Title }}" loading="lazy">
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
@@ -20,11 +20,9 @@
|
||||
<div class="project-card project-item isotope-item {{ $js_tag_classes | safeHTMLAttr }}">
|
||||
<div class="card">
|
||||
{{ with $resource }}
|
||||
{{ $filters := slice (images.GaussianBlur 21) (images.Pixelate 8) }}
|
||||
{{ $image := .Resize "550x" }}
|
||||
{{ $image_lq := (.Resize "550x q1").Filter $filters }}
|
||||
<a href="{{ $link }}" {{ $target | safeHTMLAttr }} class="card-image hover-overlay">
|
||||
<img src="{{ $image_lq.RelPermalink }}" data-src="{{ $image.RelPermalink }}" alt="{{ $item.Title }}" class="img-responsive" loading="lazy">
|
||||
<img src="{{ $image.RelPermalink }}" alt="{{ $item.Title }}" class="img-responsive" loading="lazy">
|
||||
</a>
|
||||
{{ end }}
|
||||
<div class="card-text">
|
||||
|
||||
@@ -51,11 +51,9 @@
|
||||
<div class="col-12 col-md-6 order-first {{$order}}">
|
||||
{{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
|
||||
{{ with $resource }}
|
||||
{{ $filters := slice (images.GaussianBlur 21) (images.Pixelate 8) }}
|
||||
{{ $image := .Resize "540x" }}
|
||||
{{ $image_lq := (.Resize "540x q1").Filter $filters }}
|
||||
{{if $do_link}}<a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{end}}
|
||||
<img src="{{ $image_lq.RelPermalink }}" data-src="{{ $image.RelPermalink }}" alt="{{ $item.Title }}" loading="lazy">
|
||||
<img src="{{ $image.RelPermalink }}" alt="{{ $item.Title }}" loading="lazy">
|
||||
{{if $do_link}}</a>{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<a data-fancybox="gallery-{{$album}}" href="{{ .RelPermalink }}" {{ with $caption }}data-caption="{{.|markdownify|emojify|safeHTMLAttr}}"{{ end }}>
|
||||
<img data-src="{{ $image.RelPermalink }}" loading="lazy" alt="{{ plainify $caption | default $filename }}" width="{{ $image.Width }}" height="{{ $image.Height }}">{{/* Width & height (or low res src) required for lazy loading. */}}
|
||||
<img src="{{ $image.RelPermalink }}" loading="lazy" alt="{{ plainify $caption | default $filename }}" width="{{ $image.Width }}" height="{{ $image.Height }}">{{/* Width & height (or low res src) required for lazy loading. */}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
|
||||
Reference in new issue
Block a user