perf(seo): add image dimensions and aspect-ratio handling

This commit is contained in:
Rico
2026-01-07 20:06:17 +01:00
parent cf08d2b3bb
commit e4d3a32558
4 changed files with 20 additions and 3 deletions

View File

@@ -97,7 +97,9 @@
<img src="{{ $post->thumbnail }}"
alt="{{ $post->title }}"
class="object-cover w-full h-full transition duration-700 transform hover:scale-105"
loading="eager">
loading="eager"
width="1920"
height="1080">
</div>
@endif
</header>
@@ -160,7 +162,7 @@
<a href="{{ route('posts.show', $relatedPost->slug) }}" class="flex flex-col h-full group">
<div class="overflow-hidden relative mb-4 w-full rounded-xl border transition-all aspect-video bg-stone-800 border-stone-700 group-hover:border-orange-500/50">
@if($relatedPost->thumbnail)
<img src="{{ $relatedPost->thumbnail }}" alt="{{ $relatedPost->title }}" class="object-cover w-full h-full transition duration-500 group-hover:scale-105">
<img src="{{ $relatedPost->thumbnail }}" alt="{{ $relatedPost->title }}" class="object-cover w-full h-full transition duration-500 group-hover:scale-105" width="1920" height="1080">
@else
<div class="flex justify-center items-center w-full h-full bg-gradient-to-br from-stone-800 to-stone-900 text-stone-700">
<span class="text-4xl opacity-20">LoL</span>