Lazy loading for images

This commit is contained in:
2025-12-14 17:17:07 +00:00
parent b1355a91f5
commit 4cc9b7bb93
14 changed files with 240 additions and 239 deletions

View File

@@ -56,6 +56,7 @@ class Website:
metadata = page.get_metadata()
filename = page.get_filename()
html_content = page.get_content()
html_content = re.sub(r'<img ', '<img loading="lazy" ', html_content)
html_output = template.render(
title=metadata.get('title', ''),
year=metadata.get('year', ''), # Assuming year is a string