@extends('frontend.layouts.app') @section('title', $article->meta_title ?: $article->title) @section('description', $article->meta_description ?: \Illuminate\Support\Str::limit(strip_tags($article->excerpt ?? $article->content), 160)) @if($article->featured_image) @section('og_image', \App\Services\ImageService::url($article->featured_image, 'large')) @endif @section('og_type', 'article') @section('content')
{{-- Hero immagine --}} @if($article->featured_image)
{{ $article->featured_image_caption ?? $article->title }}
@if($article->category) {{ $article->category->name }} @endif

{{ $article->title }}

@if($article->subtitle)

{{ $article->subtitle }}

@endif
@if($article->featured_image_caption)
{{ $article->featured_image_caption }}
@endif @else
@if($article->category) {{ $article->category->name }} @endif

{{ $article->title }}

@if($article->subtitle)

{{ $article->subtitle }}

@endif
@endif {{-- Meta + Contenuto --}}
{{-- Meta articolo --}}
@if($article->author) @if($article->author->avatar) {{ $article->author->name }} @else
{{ strtoupper(substr($article->author->name, 0, 1)) }}
@endif {{ $article->author->name }}
@endif @if($article->published_at) {{ $article->published_at->translatedFormat('d F Y') }} @endif @if($article->reading_time) {{ $article->reading_time }} {{ __t('article.min_read', 'min di lettura') }} @endif {{ number_format($article->views_count ?? 0) }}
{{-- Contenuto --}}
{!! $article->content !!}
{{-- Video se presente --}} @if($article->video_url) @php // Estrai ID YouTube preg_match('#(?:youtube\.com/(?:watch\?v=|embed/|shorts/)|youtu\.be/)([a-zA-Z0-9_-]{11})#', $article->video_url, $m); $ytId = $m[1] ?? null; @endphp @if($ytId)
@endif @endif {{-- Galleria --}} @if(!empty($article->gallery) && is_array($article->gallery))
@foreach($article->gallery as $img) @endforeach
@endif {{-- Tags --}} @if($article->tags && $article->tags->isNotEmpty())

{{ __t('article.tags', 'Tag') }}

@foreach($article->tags as $tag) #{{ $tag->name }} @endforeach
@endif {{-- Autore box --}} @if($article->author)
@if($article->author->avatar) @else
{{ strtoupper(substr($article->author->name, 0, 1)) }}
@endif
{{ $article->author->name }} @if($article->author->bio)

{{ $article->author->bio }}

@endif
@endif {{-- Commenti --}} @if($article->allow_comments && $approvedComments && $approvedComments->isNotEmpty())

{{ __t('article.comments', 'Commenti') }} ({{ $approvedComments->count() }})

@foreach($approvedComments as $comment)
{{ strtoupper(substr($comment->author_name ?? '?', 0, 1)) }}
{{ $comment->author_name }} {{ $comment->created_at->translatedFormat('d F Y') }}
{!! nl2br(e($comment->content)) !!}
@endforeach
@endif
{{-- Sidebar --}}
@endsection