移除懒加载

This commit is contained in:
FlintyLemming
2026-01-19 12:07:06 +08:00
parent 9d657b0e5a
commit 4a7470316f
9 changed files with 20 additions and 26 deletions

View File

@@ -29,7 +29,6 @@
{{ with $Width }}width="{{ . }}"{{ end }}
{{ with $Height }}height="{{ . }}"{{ end }}
{{ with $Srcset }}srcset="{{ . }}"{{ end }}
loading="lazy"
{{ with $alt }}
alt="{{ . }}"
{{ end }}

View File

@@ -32,12 +32,11 @@
{{- $Height = $thumbnail.Height -}}
{{- end -}}
<img src="{{ $Permalink }}"
<img src="{{ $Permalink }}"
width="{{ $Width }}"
height="{{ $Height }}"
loading="lazy">
height="{{ $Height }}">
{{ else }}
<img src="{{ $image.permalink }}" loading="lazy" />
<img src="{{ $image.permalink }}" />
{{ end }}
</div>
{{ end }}

View File

@@ -26,13 +26,12 @@
{{- $Height = $thumbnail.Height -}}
{{- end -}}
<img src="{{ $Permalink }}"
<img src="{{ $Permalink }}"
width="{{ $Width }}"
height="{{ $Height }}"
alt="{{ .Title }}"
loading="lazy">
height="{{ $Height }}"
alt="{{ .Title }}">
{{ else }}
<img src="{{ $image.permalink }}" loading="lazy" alt="Featured image of post {{ .Title }}" />
<img src="{{ $image.permalink }}" alt="Featured image of post {{ .Title }}" />
{{ end }}
</div>
{{ end }}

View File

@@ -17,15 +17,14 @@
{{- $Height = $thumbnail.Height -}}
{{- end -}}
<img src="{{ $Permalink }}"
width="{{ $Width }}"
height="{{ $Height }}"
loading="lazy"
<img src="{{ $Permalink }}"
width="{{ $Width }}"
height="{{ $Height }}"
alt="Featured image of post {{ .context.Title }}"
{{ with .context.Slug }}data-key="{{ . }}" {{ end }}
data-hash="{{ $imageRaw.Data.Integrity }}">
{{ else }}
<img src="{{ $image.permalink }}" loading="lazy" data-key="{{ .context.Slug }}" data-hash="{{ $image.permalink }}"/>
<img src="{{ $image.permalink }}" data-key="{{ .context.Slug }}" data-hash="{{ $image.permalink }}"/>
{{ end }}
</div>
{{ end }}

View File

@@ -20,12 +20,11 @@
<img src="{{ $Permalink }}"
{{ with $Srcset }}srcset="{{ . }}"{{ end }}
width="{{ $Width }}"
height="{{ $Height }}"
loading="lazy"
width="{{ $Width }}"
height="{{ $Height }}"
alt="Featured image of post {{ .Title }}" />
{{ else }}
<img src="{{ $image.permalink }}" loading="lazy" alt="Featured image of post {{ .Title }}" />
<img src="{{ $image.permalink }}" alt="Featured image of post {{ .Title }}" />
{{ end }}
</a>
</div>

View File

@@ -21,7 +21,7 @@
{{ $permalink = .RelPermalink }}
{{ end }}
<div class="article-image">
<img src="{{ $permalink }}" loading="lazy"{{ with $link.alt }} alt="{{ . }}"{{ end }}>
<img src="{{ $permalink }}"{{ with $link.alt }} alt="{{ . }}"{{ end }}>
</div>
{{ end }}
</a>

View File

@@ -11,14 +11,14 @@
<figure class="site-avatar">
<a href="{{ .Site.BaseURL | relLangURL }}">
{{ if not .local }}
<img src="{{ .src }}" width="300" height="300" class="site-logo" loading="lazy" alt="Avatar">
<img src="{{ .src }}" width="300" height="300" class="site-logo" alt="Avatar">
{{ else }}
{{ $avatar := resources.Get (.src) }}
{{ if $avatar }}
{{ $avatarResized := $avatar.Resize "300x" }}
<img src="{{ $avatarResized.RelPermalink }}" width="{{ $avatarResized.Width }}"
height="{{ $avatarResized.Height }}" class="site-logo" loading="lazy" alt="Avatar">
height="{{ $avatarResized.Height }}" class="site-logo" alt="Avatar">
{{ else }}
{{ errorf "Failed loading avatar from %q" . }}
{{ end }}

View File

@@ -3,9 +3,8 @@
{{- $ytHost := cond $pc.PrivacyEnhanced "www.youtube-nocookie.com" "www.youtube.com" -}}
{{- $id := .Get "id" | default (.Get 0) -}}
<div class="video-wrapper">
<iframe loading="lazy"
src="https://{{ $ytHost }}/embed/{{ $id }}{{ with .Get "autoplay" }}{{ if eq . "true" }}?autoplay=1{{ end }}{{ end }}"
allowfullscreen
<iframe src="https://{{ $ytHost }}/embed/{{ $id }}{{ with .Get "autoplay" }}{{ if eq . "true" }}?autoplay=1{{ end }}{{ end }}"
allowfullscreen
title="YouTube Video"
>
</iframe>