@extends('layout.front.master') @if(isset($category)) @section('title', 'Blog - ' . $category->name) @section('description', strip_tags(\Illuminate\Support\Str::limit($category->description ?? 'Explora nuestros artículos sobre ' . $category->name, 160))) @section('keywords', config('site.seo.keywords') . ', blog, noticias, ' . $category->name) {{-- Open Graph Meta Tags --}} @section('og_title', 'Blog - ' . $category->name) @section('og_description', strip_tags(\Illuminate\Support\Str::limit($category->description ?? 'Explora nuestros artículos sobre ' . $category->name, 200))) @section('og_image', brand_og_image()) @section('og_type', 'website') @section('og_url', url()->current()) {{-- Twitter Card Meta Tags --}} @section('twitter_title', 'Blog - ' . $category->name) @section('twitter_description', strip_tags(\Illuminate\Support\Str::limit($category->description ?? 'Explora nuestros artículos sobre ' . $category->name, 200))) @section('twitter_image', brand_twitter_image()) @else @php $blogTitle = config('site.modules.blog.page_header.title', config('cd-system.modules.blog.name', __('Publicaciones'))); $blogDescription = config('site.blog.sidebar_description', config('site.modules.blog.page_header.subtitle', __('Mantente informado con nuestros artículos y las últimas novedades.'))); @endphp @section('title', $blogTitle) @section('description', $blogDescription) @section('keywords', config('site.seo.keywords') . ', blog, noticias, actualizaciones, artículos') {{-- Open Graph Meta Tags --}} @section('og_title', $blogTitle) @section('og_description', $blogDescription) @section('og_image', brand_og_image()) @section('og_type', 'website') @section('og_url', url()->current()) {{-- Twitter Card Meta Tags --}} @section('twitter_title', $blogTitle) @section('twitter_description', $blogDescription) @section('twitter_image', brand_twitter_image()) @endif @section('content') @php $activeDemo = get_active_demo(); @endphp {{-- Dynamic Header — usa el partial del demo activo (registrado en dynamic-header.blade.php) --}} @include('modules.blog.frontend.partials.dynamic-header') @php $activeDemo = get_active_demo(); $isProductLanding = ($activeDemo === 'demo-product-landing'); @endphp @if($isProductLanding) {{-- Product Landing Style --}}
{{ __('ARTÍCULOS') }}

{{ __('Últimos') }} {{ __('Posts') }}

{{ config('site.blog.sidebar_description', __('Mantente informado con nuestros artículos y las últimas novedades.')) }}

@if ($posts->isEmpty())

{{ __('blog_under_construction') }}

{!! __('blog_no_posts_message') !!}

@else
@foreach ($posts as $post)
@php $postImage = null; if ($post->header) { $headerPath = filter_var($post->header, FILTER_VALIDATE_URL) ? $post->header : $post->header; if (filter_var($post->header, FILTER_VALIDATE_URL)) { $postImage = $headerPath; } elseif (file_exists(public_path($headerPath))) { $postImage = asset($headerPath); } else { $postImage = asset('cd-project/img/blog/' . (($loop->index % 2) + 1) . '.jpg'); } } else { $postImage = asset('cd-project/img/blog/' . (($loop->index % 2) + 1) . '.jpg'); } @endphp @if($postImage) {{ $post->title }} @endif
@if($post->category) {{ $post->category->name }} @endif

{{ $post->title }}

@php $desc = $post->description ?? ''; $excerptText = trim($desc) !== '' ? Str::limit($desc, 120) : (trim($post->excerpt ?? '') !== '' ? Str::limit($post->excerpt, 120) : Str::limit(strip_tags($post->getAttribute('content') ?? ''), 120)); $excerptText = trim($excerptText) !== '' ? $excerptText : __('Leer artículo completo'); @endphp

{{ $excerptText }}

{{ __('Leer Más') }}
@endforeach
@include('modules.blog.frontend.partials.pagination', ['paginator' => $posts]) @endif

{{ __('¿Quieres') }} {{ __('escribir') }} {{ __('para nuestro blog?') }}

{{ __('Comparte tu experiencia y conocimiento con nuestra comunidad') }}

@else {{-- Default Style (All Demos with Sidebar) --}}
@if ($posts->isEmpty())

{{ __('Próximamente') }}

{{ __('Estamos preparando contenido. Volvé pronto.') }}

{{ __('Volver al inicio') }}
@else @foreach ($posts as $index => $post) @php $postImage = null; if ($post->header) { $postImage = filter_var($post->header, FILTER_VALIDATE_URL) ? $post->header : asset($post->header); } @endphp
@if($postImage)
@else
@endif
@if($post->category) {{ $post->category->name }} @endif {{ $post->created_at->format('d M Y') }}

{{ $post->title }}

@if($post->description)

{{ Str::limit($post->description, 100, '...') }}

@endif
@endforeach @endif @include('modules.blog.frontend.partials.pagination', ['paginator' => $posts])
@endif @endsection @section('scripts') @endsection