mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-21 02:11:52 +02: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 }}
|
{{ $caption := .Title }}
|
||||||
{{ if findRE "^https?" $url.Scheme }}
|
{{ if findRE "^https?" $url.Scheme }}
|
||||||
<figure>
|
<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 }}
|
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||||
</figure>
|
</figure>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
@ -19,12 +19,14 @@
|
||||||
{{ if $disableImageOptimization }}
|
{{ if $disableImageOptimization }}
|
||||||
<img
|
<img
|
||||||
class="my-0 rounded-md"
|
class="my-0 rounded-md"
|
||||||
|
loading="lazy"
|
||||||
src="{{ .RelPermalink }}"
|
src="{{ .RelPermalink }}"
|
||||||
alt="{{ $altText }}"
|
alt="{{ $altText }}"
|
||||||
/>
|
/>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<img
|
<img
|
||||||
class="my-0 rounded-md"
|
class="my-0 rounded-md"
|
||||||
|
loading="lazy"
|
||||||
srcset="
|
srcset="
|
||||||
{{ (.Resize "330x").RelPermalink }} 330w,
|
{{ (.Resize "330x").RelPermalink }} 330w,
|
||||||
{{ (.Resize "660x").RelPermalink }} 660w,
|
{{ (.Resize "660x").RelPermalink }} 660w,
|
||||||
|
@ -38,7 +40,7 @@
|
||||||
</figure>
|
</figure>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<figure>
|
<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 }}
|
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||||
</figure>
|
</figure>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue