Skip to content

Commit b2ddd58

Browse files
committed
feat: add back up image to article on overview summary
1 parent 56cbf23 commit b2ddd58

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

resources/views/components/articles/overview-summary.blade.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66

77
<div class="h-full rounded-lg shadow-lg bg-white lg:p-5">
88
<div class="flex flex-col gap-x-8 lg:flex-row">
9-
<a href="{{ route('articles.show', $article->slug()) }}" class="block">
10-
<div
11-
class="w-full h-32 rounded-t-lg bg-center {{ $article->hasHeroImage() ? 'bg-cover' : '' }} bg-gray-800 lg:w-48 lg:h-full lg:rounded-lg"
12-
style="background-image: url({{ $article->heroImage() }});"
9+
<a href="{{ route('articles.show', $article->slug()) }}" class="block lg:aspect-video">
10+
<img class="w-full h-32 rounded-t-lg bg-center bg-gray-800 lg:h-full lg:w-48 lg:rounded-lg object-none max-w-none"
11+
src="{{ $article->heroImage() }}"
12+
alt="Article Hero Image"
13+
onerror="
14+
this.onerror=null;
15+
this.src='images/default-background.svg';"
1316
>
14-
</div>
1517
</a>
1618

1719
<div class="flex flex-col gap-y-3 p-4 lg:p-0 lg:gap-y-3.5 w-full">

0 commit comments

Comments
 (0)