Add tests for featured thumbnail generation; apply Pint formatting and related edits
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user