{{-- Blog card component — featured and compact variants (Story 5.8) --}} @props([ 'article', 'variant' => 'compact', 'locale' => app()->getLocale(), ]) @php $articleUrl = $article->publicUrl(); // Editor excerpt, else the first paragraph $excerpt = $article->summary(120); // Resolve thumbnail: OG image or first image block // The image is decorative here: the card title already names the link $thumbnail = $article->ogImageUrl(); if (! $thumbnail && !empty($article->blocks) && is_array($article->blocks)) { foreach ($article->blocks as $block) { if (($block['type'] ?? '') === 'image') { $imgPath = $block['data']['path'] ?? $block['data']['url'] ?? ''; if (is_array($imgPath)) { $imgPath = $imgPath[0] ?? ''; } if ($imgPath) { $thumbnail = str_starts_with($imgPath, 'http') ? $imgPath : \Illuminate\Support\Facades\Storage::disk('public')->url($imgPath); } break; } } } @endphp @if($variant === 'featured') {{-- Featured variant: large card, image beside text, full-width --}}
{{ __('blog.featured') }}
@if($thumbnail) @else
@endif
@if($article->tags->isNotEmpty()) @foreach($article->tags->take(2) as $tag) {{ $tag->name }} @endforeach @endif @if($article->published_at) @endif {{ $article->read_time }} min

{{ $article->title }}

@if($excerpt)

{{ $excerpt }}

@endif {{ __('blog.read_more') }}
@else {{-- Compact variant: standard card for grid layout --}}
@if($thumbnail) @else
@endif
@if($article->tags->isNotEmpty()) @foreach($article->tags->take(2) as $tag) {{ $tag->name }} @endforeach @endif @if($article->published_at) @endif {{ $article->read_time }} min

{{ $article->title }}

@if($excerpt)

{{ $excerpt }}

@endif
@endif