mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-02-02 03:22:33 -06:00
add loading lazy to image render
This commit is contained in:
parent
893687d0d4
commit
f421ce16c8
1 changed files with 4 additions and 2 deletions
|
@ -4,7 +4,7 @@
|
|||
{{ $caption := .Title }}
|
||||
{{ if findRE "^https?" $url.Scheme }}
|
||||
<figure>
|
||||
<img class="my-0 rounded-md" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
<img class="my-0 rounded-md" loading="lazy" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
{{ else }}
|
||||
|
@ -19,12 +19,14 @@
|
|||
{{ if $disableImageOptimization }}
|
||||
<img
|
||||
class="my-0 rounded-md"
|
||||
loading="lazy"
|
||||
src="{{ .RelPermalink }}"
|
||||
alt="{{ $altText }}"
|
||||
/>
|
||||
{{ else }}
|
||||
<img
|
||||
class="my-0 rounded-md"
|
||||
loading="lazy"
|
||||
srcset="
|
||||
{{ (.Resize "330x").RelPermalink }} 330w,
|
||||
{{ (.Resize "660x").RelPermalink }} 660w,
|
||||
|
@ -38,7 +40,7 @@
|
|||
</figure>
|
||||
{{ else }}
|
||||
<figure>
|
||||
<img class="my-0 rounded-md" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
<img class="my-0 rounded-md" loading="lazy" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in a new issue