1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-09-15 18:56:59 +00:00

Add lazy loading attribute in templates

This commit is contained in:
Bente Groh 2025-06-25 00:28:03 +02:00
parent cea717b228
commit 1f8f7f20c0
2 changed files with 2 additions and 2 deletions

View file

@ -4,7 +4,7 @@
{{if $attachments}}
<div class="card-attachment-images">
{{range $attachments}}
<img src="{{.DownloadURL}}" alt="{{.Name}}" />
<img src="{{.DownloadURL}}" alt="{{.Name}}" loading="lazy"/>
{{end}}
</div>
{{end}}

View file

@ -31,7 +31,7 @@
{{if FilenameIsImage .Name}}
{{if not (StringUtils.Contains (StringUtils.ToString $.RenderedContent) .UUID)}}
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
<img alt="{{.Name}}" src="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}">
<img alt="{{.Name}}" src="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}" loading="lazy">
</a>
{{end}}
{{end}}