pub / stories

Top News Aggregator
git clone src.jayvii.de/pub/stories.git
Home | Log | Files | Exports | Refs | RSS

commit 11a1c3d397575f3e058c7d1fe9a01eefd5584b9e
parent 65ba684932e9836dae92decadbed0a97211ff305
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Sat, 31 Oct 2026 21:37:44 +0100

fix: lazy loading of image

Diffstat:
Mindex.tt | 3++-
Mlib/og_image.php | 2++
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/index.tt b/index.tt @@ -130,9 +130,10 @@ <section> <!-- Head image --> <img + loading="lazy" src="assets/fallback.svg" style="width:100%;height:100%;max-height:250px;object-fit:cover;margin-top:1em;" - onload="insert_og_image(this, '<?php echo $entry['url']; ?>');" + onload="setTimeout(function(){insert_og_image(this, '<?php echo $entry['url']; ?>')}, 0);" > <!-- Headline --> <h4 style="margin-bottom:5px;"> diff --git a/lib/og_image.php b/lib/og_image.php @@ -24,3 +24,5 @@ if (!empty($html)) { } // return OG Image URL echo $image_url; + +?>