Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lazy loading #319

Open
jano31coa opened this issue Dec 1, 2022 · 1 comment
Open

lazy loading #319

jano31coa opened this issue Dec 1, 2022 · 1 comment
Labels
enhancement New feature or functionality

Comments

@jano31coa
Copy link

jano31coa commented Dec 1, 2022

Hello,
First, thanks for thumbsup, it really is something I have been looking for a long time. As a non professionnal in programming, it is the perfect. I just used the docker release in a Debian VM.

I know lazy loading had been discussed previously but is now very easy to implement I think, Because now web browser handles it on their own (see mozilla)

Actually I did myself by replacing all alt= with loading="lazy" alt= in the index.html file with notepad. I have an album with ~2000 elements and it changes everything. Without it the page takes ~5-10 seconds to load from external USB drive (so maybe longer if hosted online). With it it is instant.

Do you think this could be implemented ? I could do it but I wouldn't know where to start :)

Best regards,
JR

@jano31coa jano31coa added the enhancement New feature or functionality label Dec 1, 2022
@rprieto
Copy link
Member

rprieto commented Dec 8, 2022

Hi @jano31coa, thanks for raising this and for the detailed investigation. This is very good news!

This is typically something that would be implemented by the themes. However… most (all?) themes rely on the central thumbnail.hbs partial view that ships with Thumbsup itself: https://github.com/thumbsup/thumbsup/blob/master/src/website/theme-base/partials/thumbnail.hbs This means changing it here will benefit everyone.

The only test I can think of is that this might affect the official flow theme, which does a dynamic layout based on each photos size: https://github.com/thumbsup/theme-flow

Do you mind trying to download the theme, add the loading="lazy" attribute, and check if it still works? You can point to your local modified theme using --theme-path <…>.

If it works then you can make a PR for the thumbnail.hbs change and we can have it shipped soon!

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or functionality
Projects
None yet
Development

No branches or pull requests

2 participants