Skip to content

Commit

Permalink
Lazy load avatar images (#32051)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiifong authored Sep 17, 2024
1 parent 7dde3e6 commit f38e101
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/templates/util_avatar.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func AvatarHTML(src string, size int, class, name string) template.HTML {
name = "avatar"
}

return template.HTML(`<img class="` + class + `" src="` + src + `" title="` + html.EscapeString(name) + `" width="` + sizeStr + `" height="` + sizeStr + `"/>`)
return template.HTML(`<img loading="lazy" class="` + class + `" src="` + src + `" title="` + html.EscapeString(name) + `" width="` + sizeStr + `" height="` + sizeStr + `"/>`)
}

// Avatar renders user avatars. args: user, size (int), class (string)
Expand Down

0 comments on commit f38e101

Please sign in to comment.