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

✨feat(image shortcodes): add lazy loading, set optional alt attributes & optimise html #116

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

welpo
Copy link
Owner

@welpo welpo commented Aug 25, 2023

TL;DR Enhanced image shortcodes with default lazy loading, optional alt attributes, and cleaner HTML output.

Description

This PR aims to enhance the UX and performance by introducing lazy loading to all image shortcodes and making the alt attributes optional. These changes bring about improved page loading times and give more control to users over image rendering.

Lazy loading (lazy_loading parameter):

  • Lazy loading has been added to all image-related shortcodes. This defers the loading of images until they are in the viewport, improving page loading time.
  • Enabled by default but can be disabled by setting the lazy_loading parameter to false.

Optional alt attributes:

  • The alt attribute for images is now optional across all shortcodes. This provides greater flexibility while ensuring that best practices can still be followed.

HTML output optimisation:

  • Improved the Tera templates to generate cleaner HTML by managing whitespace.

- Implement lazy loading in all image shortcodes, enabled by default.

- Make alt attributes optional across all image shortcodes.

- Optimize HTML output by managing whitespace.
@welpo welpo added the enhancement New feature or request label Aug 25, 2023
@welpo welpo merged commit 1c3db86 into main Aug 25, 2023
1 check passed
@welpo welpo deleted the feat/lazy-loading-img-shortcodes branch August 25, 2023 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant