Fix thumbnail loading and startup gallery refresh.
Refresh gallery metadata after thumbnail generation so new thumb URLs are available immediately, and lazy-load gallery thumbnails with IntersectionObserver to avoid fetching all images on initial page load. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -22,7 +22,9 @@ templ GalleryGrid(images []gallery.Image) {
|
||||
>
|
||||
if img.ThumbURL != "" {
|
||||
<img
|
||||
src={ img.ThumbURL }
|
||||
src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="
|
||||
data-src={ img.ThumbURL }
|
||||
class="lazy-thumb"
|
||||
alt={ fmt.Sprintf("%s — %s", gallery.AlbumLabel(img.Album), formatDate(img.Date)) }
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
|
||||
Reference in New Issue
Block a user