移除懒加载

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

@@ -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 }}