{{ $article->excerpt }}
@endif@php
$isPreview = (bool) ($previewMode ?? false);
$articleUrl = $isPreview ? ($previewCanonical ?? url()->current()) : route('news.show', $article->slug);
$articleSchemaImage = $article->effective_og_image
? url($article->effective_og_image)
: url((string) config('seo.fallback_image_path', '/gfx/skinbase_back_001.webp'));
$articleCoverSizes = '(max-width: 767px) calc(100vw - 3rem), (max-width: 1279px) calc(100vw - 5rem), 768px';
$articleCoverPreloadHref = $article->cover_desktop_url ?: $article->cover_url;
$seo = \App\Support\Seo\SeoDataBuilder::fromArray([
'title' => $article->meta_title ?: $article->title,
'description' => $article->meta_description ?: Str::limit(strip_tags((string) $article->excerpt), 160),
'keywords' => $article->meta_keywords,
'canonical' => $isPreview ? $articleUrl : ($article->canonical_url ?: $articleUrl),
'robots' => $isPreview ? 'noindex,nofollow' : 'index,follow',
'og_type' => 'article',
'og_title' => $article->effective_og_title,
'og_description' => $article->effective_og_description,
'og_image' => $article->effective_og_image,
'breadcrumbs' => collect([
(object) ['name' => 'Home', 'url' => url('/')],
(object) ['name' => 'News', 'url' => route('news.index')],
$article->category
? (object) ['name' => $article->category->name, 'url' => route('news.category', $article->category->slug)]
: null,
])->filter()->values(),
])
->addJsonLd(array_filter([
'@context' => 'https://schema.org',
'@type' => 'NewsArticle',
'headline' => $article->title,
'description' => $article->meta_description ?: Str::limit(strip_tags((string) $article->excerpt), 160),
'image' => $articleSchemaImage
? array_filter([
'@type' => 'ImageObject',
'url' => $articleSchemaImage,
'contentUrl' => $articleSchemaImage,
'thumbnailUrl' => $article->cover_mobile_url,
'caption' => $article->title,
], fn (mixed $value): bool => $value !== null && $value !== '')
: null,
'datePublished' => $article->published_at?->toIso8601String(),
'dateModified' => $article->updated_at?->toIso8601String(),
'articleSection' => $article->category?->name,
'author' => array_filter([
'@type' => 'Person',
'name' => $article->author?->name,
]),
'publisher' => [
'@type' => 'Organization',
'name' => config('seo.site_name', 'Skinbase'),
],
'mainEntityOfPage' => $articleUrl,
], fn (mixed $value): bool => $value !== null && $value !== ''))
->build();
@endphp
@push('head')
@if($articleCoverPreloadHref)
cover_srcset) imagesrcset="{{ $article->cover_srcset }}" imagesizes="{{ $articleCoverSizes }}" @endif
fetchpriority="high"
>
@endif
@endpush
@extends('news.layout', [
'metaTitle' => $article->meta_title ?: $article->title,
'metaDescription' => $article->meta_description ?: Str::limit(strip_tags((string)$article->excerpt), 160),
'metaCanonical' => $isPreview ? $articleUrl : ($article->canonical_url ?: $articleUrl),
'metaRobots' => $isPreview ? 'noindex,nofollow' : 'index,follow',
])
@section('news_content')
@php
$headerBreadcrumbs = collect([
(object) ['name' => 'Home', 'url' => url('/')],
(object) ['name' => 'News', 'url' => route('news.index')],
$article->category
? (object) ['name' => $article->category->name, 'url' => route('news.category', $article->category->slug)]
: null,
])->filter()->values();
@endphp
{{ $article->excerpt }}
@endif