Add tests for featured thumbnail generation; apply Pint formatting and related edits

This commit is contained in:
2026-05-06 18:55:40 +02:00
parent 7a8bc8e22a
commit 82f2b1f660
65 changed files with 11325 additions and 49545 deletions

View File

@@ -6,15 +6,50 @@
@section('news_content')
@php
$articleItems = collect($articles->items());
$headerBreadcrumbs = collect([
(object) ['name' => 'Community', 'url' => route('community.activity')],
(object) ['name' => 'Announcements', 'url' => route('news.index')],
(object) ['name' => 'News', 'url' => route('news.index')],
(object) ['name' => $category->name, 'url' => route('news.category', $category->slug)],
]);
$structuredData = [
[
'@context' => 'https://schema.org',
'@type' => 'CollectionPage',
'name' => $category->name . ' — News',
'description' => $category->description ?: ('Announcements filed under ' . $category->name . '.'),
'url' => route('news.category', $category->slug),
],
];
if ($articleItems->isNotEmpty()) {
$structuredData[] = [
'@context' => 'https://schema.org',
'@type' => 'ItemList',
'name' => $category->name . ' — News Articles',
'description' => 'Published News stories in the ' . $category->name . ' category.',
'url' => route('news.category', $category->slug),
'numberOfItems' => $articleItems->count(),
'itemListElement' => $articleItems->values()->map(fn ($article, int $index): array => [
'@type' => 'ListItem',
'position' => $index + 1,
'name' => $article->title,
'url' => route('news.show', ['slug' => $article->slug]),
])->all(),
];
}
$seo = \App\Support\Seo\SeoDataBuilder::fromArray([
'title' => $category->name . ' — News',
'description' => $category->description ?: ('Announcements in the ' . $category->name . ' category.'),
'canonical' => route('news.category', $category->slug),
'breadcrumbs' => $headerBreadcrumbs,
'structured_data' => $structuredData,
])->build();
@endphp
<x-nova-page-header
section="Community"
section="News"
:title="$category->name"
icon="fa-folder-open"
:breadcrumbs="$headerBreadcrumbs"