1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-02 07:38:35 +00:00

Improve img lazy loading (#34804)

Related #32051 and #13526
This commit is contained in:
wxiaoguang
2025-06-21 14:53:22 +08:00
committed by GitHub
parent 0990eb44ce
commit 81adb01713
11 changed files with 30 additions and 17 deletions

View File

@@ -21,7 +21,7 @@
{{else if not .IsTextFile}}
<div class="view-raw">
{{if .IsImageFile}}
<img alt="{{$.RawFileLink}}" src="{{$.RawFileLink}}">
<img loading="lazy" alt="{{$.RawFileLink}}" src="{{$.RawFileLink}}">
{{else if .IsVideoFile}}
<video controls src="{{$.RawFileLink}}">
<strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong>