From e4d3a32558224110308472f1ade85b56cb308aeb Mon Sep 17 00:00:00 2001 From: Rico Date: Wed, 7 Jan 2026 20:06:17 +0100 Subject: [PATCH] perf(seo): add image dimensions and aspect-ratio handling --- resources/css/app.css | 13 +++++++++++++ resources/views/components/icons/list_all.blade.php | 2 +- .../views/components/posts/listposts.blade.php | 2 ++ resources/views/posts/show.blade.php | 6 ++++-- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/resources/css/app.css b/resources/css/app.css index 53a3c2e..1819820 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -129,3 +129,16 @@ ins.adsbygoogle[data-ad-status="unfilled"] { overflow-y: auto; overflow-x: auto; } + +.prose img { + height: auto; + max-width: 100%; +} + +.prose img:not([width]):not([height]) { + aspect-ratio: attr(width) / attr(height); +} + +.prose img[width][height] { + aspect-ratio: attr(width) / attr(height); +} diff --git a/resources/views/components/icons/list_all.blade.php b/resources/views/components/icons/list_all.blade.php index 8e0dc86..df40a0f 100644 --- a/resources/views/components/icons/list_all.blade.php +++ b/resources/views/components/icons/list_all.blade.php @@ -20,7 +20,7 @@ {{ $icon->title }} Icon + class="object-cover w-full h-full" alt="{{ $icon->title }} Icon" width="96" height="96" />
diff --git a/resources/views/components/posts/listposts.blade.php b/resources/views/components/posts/listposts.blade.php index 889bc6e..f8a68f3 100644 --- a/resources/views/components/posts/listposts.blade.php +++ b/resources/views/components/posts/listposts.blade.php @@ -12,6 +12,8 @@ src="{{ $post->thumbnail }}" alt="{{ $post->title }} Thumbnail" class="object-cover w-full h-full" + width="1200" + height="630" > diff --git a/resources/views/posts/show.blade.php b/resources/views/posts/show.blade.php index de3cb9e..a121f6f 100644 --- a/resources/views/posts/show.blade.php +++ b/resources/views/posts/show.blade.php @@ -97,7 +97,9 @@ {{ $post->title }} + loading="eager" + width="1920" + height="1080">
@endif @@ -160,7 +162,7 @@
@if($relatedPost->thumbnail) - {{ $relatedPost->title }} + {{ $relatedPost->title }} @else
LoL