@extends('public.layout') @php if (!function_exists('calculateReadingTime')) { function calculateReadingTime($body) { if (!$body) { return 2; } $text = strip_tags($body); $words = str_word_count($text); $minutes = ceil($words / 200); return max(1, $minutes); } } // Garantir que seoData existe e tem valores padrão if (!isset($seoData)) { $seoData = []; } @endphp @section('seo') @php // Passar dados de SEO para o layout // O layout já acessa $seoData diretamente @endphp @endsection @section('content') {{-- Banner no topo da página --}}
@include('components.banners', ['regionCode' => 'topo', 'isHomepage' => true])
@php $xsmallArticles = $latestNews->take(4); @endphp @foreach ($xsmallArticles as $article) @php $articleImage = $article->topImage ?? $article->featuredImage; $articleUrl = "/{$article->slug}"; $shareUrl = urlencode(url($articleUrl)); $shareTitle = urlencode($article->title); $shareImage = urlencode($articleImage?->file_url ?? ''); $readingTime = calculateReadingTime($article->body); @endphp
@if ($articleImage && $articleImage->file_url) {{ $articleImage->alt_text ?? $article->title }} @endif
@if ($article->section) {{ $article->section->name }} @endif

{{ $article->title }}

@endforeach
@if ($featuredTop5->count() > 0) @php $pinnedArticle = $featuredTop5->where('pinned_to_homepage', true)->first(); $mainArticle = $pinnedArticle ?? $featuredTop5->first(); $articleImage = $mainArticle->topImage ?? $mainArticle->featuredImage; $articleUrl = "/{$mainArticle->slug}"; $shareUrl = urlencode(url($articleUrl)); $shareTitle = urlencode($mainArticle->title); $shareImage = urlencode($articleImage?->file_url ?? ''); $readingTime = calculateReadingTime($mainArticle->body); $authorName = $mainArticle->authorUser?->name ?? ($mainArticle->author_name ?? ($mainArticle->author ?? 'Redação')); $authorAvatar = $mainArticle->authorUser?->avatar_url ?? '/assets/theme/v6/images/profile_1-120x120.jpeg'; @endphp
@if ($articleImage && $articleImage->file_url) {{ $articleImage->alt_text ?? $mainArticle->title }} @endif
@if ($mainArticle->section) {{ $mainArticle->section->name }} @endif

{{ $mainArticle->title }}

@if ($mainArticle->headline || $mainArticle->excerpt)

{{ Str::limit($mainArticle->headline ?? ($mainArticle->excerpt ?? ''), 150) }}

@endif
@php $remainingArticles = $featuredTop5->reject(function ($article) use ($mainArticle) { return $article->id === $mainArticle->id; })->take(2); @endphp @foreach ($remainingArticles as $article) @php $articleImage = $article->topImage ?? $article->featuredImage; $articleUrl = "/{$article->slug}"; $shareUrl = urlencode(url($articleUrl)); $shareTitle = urlencode($article->title); $shareImage = urlencode($articleImage?->file_url ?? ''); $readingTime = calculateReadingTime($article->body); $authorName = $article->authorUser?->name ?? ($article->author_name ?? ($article->author ?? 'Redação')); $authorAvatar = $article->authorUser?->avatar_url ?? '/assets/theme/v6/images/profile_1-120x120.jpeg'; @endphp
@if ($articleImage && $articleImage->file_url) {{ $articleImage->alt_text ?? $article->title }} @endif
@if ($article->section) {{ $article->section->name }} @endif

{{ $article->title }}

@endforeach @endif
-Sponsored-
@include('components.banners', ['regionCode' => 'meio', 'isHomepage' => true])

Editor pick's

Find more

@php $gridArticles = $featuredOffset5->take(4); @endphp @foreach ($gridArticles as $article) @php $articleImage = $article->topImage ?? $article->featuredImage; $articleUrl = "/{$article->slug}"; $shareUrl = urlencode(url($articleUrl)); $shareTitle = urlencode($article->title); $shareImage = urlencode($articleImage?->file_url ?? ''); $readingTime = calculateReadingTime($article->body); $authorName = $article->authorUser?->name ?? ($article->author_name ?? ($article->author ?? 'Redação')); $authorAvatar = $article->authorUser?->avatar_url ?? '/assets/theme/v6/images/profile_1-120x120.jpeg'; @endphp
@if ($articleImage && $articleImage->file_url) {{ $articleImage->alt_text ?? $article->title }} @endif
@if ($article->section) {{ $article->section->name }} @endif

{{ $article->title }}

@if ($article->headline || $article->excerpt)

{{ Str::limit($article->headline ?? ($article->excerpt ?? ''), 150) }}

@endif
@endforeach
{{-- Bloco "Stories for you" com feature-video --}}

Stories for you

Find more

{{-- Feature Video Block - placeholder, pode ser implementado depois se necessário --}}
{{-- Video block placeholder --}}
{{-- Bloco "Lifestyle blogs" com large-post e list-post --}}

Lifestyle blogs

Find more

{{-- Large Post Block --}}
@php $largePost = $featuredOffset5->skip(4)->first() ?? $latestNews->skip(4)->first(); @endphp @if ($largePost) @php $articleImage = $largePost->topImage ?? $largePost->featuredImage; $articleUrl = "/{$largePost->slug}"; $shareUrl = urlencode(url($articleUrl)); $shareTitle = urlencode($largePost->title); $shareImage = urlencode($articleImage?->file_url ?? ''); $readingTime = calculateReadingTime($largePost->body); $authorName = $largePost->authorUser?->name ?? ($largePost->author_name ?? ($largePost->author ?? 'Redação')); $authorAvatar = $largePost->authorUser?->avatar_url ?? '/assets/theme/v6/images/profile_1-120x120.jpeg'; @endphp
@if ($articleImage && $articleImage->file_url) {{ $articleImage->alt_text ?? $largePost->title }} @endif
@if ($largePost->section) {{ $largePost->section->name }} @endif

{{ $largePost->title }}

@if ($largePost->headline || $largePost->excerpt)

{{ Str::limit($largePost->headline ?? ($largePost->excerpt ?? ''), 150) }}

@endif
@endif
{{-- List Post Block --}}
@php $listPosts = $latestNews->skip(8)->take(5); @endphp @foreach ($listPosts as $article) @php $articleImage = $article->topImage ?? $article->featuredImage; $articleUrl = "/{$article->slug}"; $shareUrl = urlencode(url($articleUrl)); $shareTitle = urlencode($article->title); $shareImage = urlencode($articleImage?->file_url ?? ''); $readingTime = calculateReadingTime($article->body); $authorName = $article->authorUser?->name ?? ($article->author_name ?? ($article->author ?? 'Redação')); $authorAvatar = $article->authorUser?->avatar_url ?? '/assets/theme/v6/images/profile_1-120x120.jpeg'; @endphp
@if ($articleImage && $articleImage->file_url) {{ $articleImage->alt_text ?? $article->title }} @endif
@if ($article->section) {{ $article->section->name }} @endif

{{ $article->title }}

@if ($article->headline || $article->excerpt)

{{ Str::limit($article->headline ?? ($article->excerpt ?? ''), 150) }}

@endif
@endforeach
{{-- Bloco "Worldwide news" com feature-layout7 --}}

Worldwide news

Find more

@php $fr7Main = $featuredOffset5->skip(5)->first() ?? $latestNews->skip(13)->first(); @endphp @if ($fr7Main) @php $articleImage = $fr7Main->topImage ?? $fr7Main->featuredImage; $articleUrl = "/{$fr7Main->slug}"; $shareUrl = urlencode(url($articleUrl)); $shareTitle = urlencode($fr7Main->title); $shareImage = urlencode($articleImage?->file_url ?? ''); $readingTime = calculateReadingTime($fr7Main->body); $authorName = $fr7Main->authorUser?->name ?? ($fr7Main->author_name ?? ($fr7Main->author ?? 'Redação')); $authorAvatar = $fr7Main->authorUser?->avatar_url ?? '/assets/theme/v6/images/profile_1-120x120.jpeg'; @endphp
@if ($articleImage && $articleImage->file_url) {{ $articleImage->alt_text ?? $fr7Main->title }} @endif
@if ($fr7Main->section) {{ $fr7Main->section->name }} @endif

{{ $fr7Main->title }}

@if ($fr7Main->headline || $fr7Main->excerpt)

{{ Str::limit($fr7Main->headline ?? ($fr7Main->excerpt ?? ''), 150) }}

@endif
@php $fr7Remaining = $featuredOffset5->skip(6)->take(3) ?? $latestNews->skip(14)->take(3); @endphp @foreach ($fr7Remaining as $article) @php $articleImage = $article->topImage ?? $article->featuredImage; $articleUrl = "/{$article->slug}"; $shareUrl = urlencode(url($articleUrl)); $shareTitle = urlencode($article->title); $shareImage = urlencode($articleImage?->file_url ?? ''); $readingTime = calculateReadingTime($article->body); $authorName = $article->authorUser?->name ?? ($article->author_name ?? ($article->author ?? 'Redação')); $authorAvatar = $article->authorUser?->avatar_url ?? '/assets/theme/v6/images/profile_1-120x120.jpeg'; @endphp
@if ($articleImage && $articleImage->file_url) {{ $articleImage->alt_text ?? $article->title }} @endif
@if ($article->section) {{ $article->section->name }} @endif

{{ $article->title }}

@endforeach @endif
{{-- Bloco Social List e Grid Overlay --}}
{{-- Social List Block - placeholder --}}
{{-- Social links placeholder --}}
{{-- Section Title "Explore more" --}}

Explore more

{{-- Grid Overlay Block --}}
@php $overlayPost = $featuredOffset5->skip(9)->first() ?? $latestNews->skip(17)->first(); @endphp @if ($overlayPost) @php $articleImage = $overlayPost->topImage ?? $overlayPost->featuredImage; $articleUrl = "/{$overlayPost->slug}"; $shareUrl = urlencode(url($articleUrl)); $shareTitle = urlencode($overlayPost->title); $shareImage = urlencode($articleImage?->file_url ?? ''); $readingTime = calculateReadingTime($overlayPost->body); $authorName = $overlayPost->authorUser?->name ?? ($overlayPost->author_name ?? ($overlayPost->author ?? 'Redação')); $authorAvatar = $overlayPost->authorUser?->avatar_url ?? '/assets/theme/v6/images/profile_1-120x120.jpeg'; @endphp
@if ($articleImage && $articleImage->file_url) {{ $articleImage->alt_text ?? $overlayPost->title }} @endif
@if ($overlayPost->section) {{ $overlayPost->section->name }} @endif

{{ $overlayPost->title }}

@endif
{{-- Bloco de anúncios adicional --}}
-Sponsored-
@include('components.banners', ['regionCode' => 'rodape', 'isHomepage' => true])
{{-- Bloco "Recent posts" --}}

Recent posts

Find more

@php $recentPosts = $latestNews->skip(18)->take(4); @endphp @foreach ($recentPosts as $article) @php $articleImage = $article->topImage ?? $article->featuredImage; $articleUrl = "/{$article->slug}"; $shareUrl = urlencode(url($articleUrl)); $shareTitle = urlencode($article->title); $shareImage = urlencode($articleImage?->file_url ?? ''); $readingTime = calculateReadingTime($article->body); $authorName = $article->authorUser?->name ?? ($article->author_name ?? ($article->author ?? 'Redação')); $authorAvatar = $article->authorUser?->avatar_url ?? '/assets/theme/v6/images/profile_1-120x120.jpeg'; @endphp
@if ($articleImage && $articleImage->file_url) {{ $articleImage->alt_text ?? $article->title }} @endif
@if ($article->section) {{ $article->section->name }} @endif

{{ $article->title }}

@if ($article->headline || $article->excerpt)

{{ Str::limit($article->headline ?? ($article->excerpt ?? ''), 150) }}

@endif
@endforeach
@endsection