Skip to content

Conversation

AnmolChauhan1234
Copy link

Changes

  1. Added add_lazy_loading filter in blog_extras.py

  2. Applied filter to object.body_html in blog templates (entry_detail.html)

  3. Added tests in blog/tests/test_lazy_loading.py to ensure:

    • Attributes are added

    • Existing attributes are preserved

    • Multiple images are handled

    • Non-image tags remain untouched

  4. Added test settings (settings/test.py) for faster CI

  5. Updated foundation template for consistency

Issue

Fixes #2154

Impact

Ensures images are lazy-loaded by default, improving initial load times without breaking existing functionality.

- Added add_lazy_loading filter in blog_extras.py
- Applied filter to object.body_html in blog templates (entry_detail.html, meeting_detail.html)
- Added unit tests in blog/tests/test_lazy_loading.py
- Added test settings (settings/test.py) for faster CI runs
- Updated foundation template for consistency

Fixes django#2154
@AnmolChauhan1234 AnmolChauhan1234 force-pushed the feat/lazy-load-blog-images branch from 3b5fdad to 85c6eef Compare August 19, 2025 19:42
@AnmolChauhan1234
Copy link
Author

Hi, this is my first contribution. Please let me know if any further changes are needed.

@SaptakS
Copy link
Contributor

SaptakS commented Aug 20, 2025

Thanks for submitting a PR @AnmolChauhan1234 ! As a next step, someone from the Website WG will review this PR, and leave any comments or changes that might be needed or approve the PR for merging.

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

Successfully merging this pull request may close these issues.

Lazy-loading for images in blog content
2 participants