web: Jahresarchiv je Branche, Kategoriebeschreibungen, Portalname im Titel (Roadmap 2.3)
- /de/category/{slug}/archiv/{jahr} (CategoryArchivePageData,
CategoryArchiveController, View kategorie-archiv): 30 Meldungen je
Seite, neueste zuerst, Jahresleiste mit Zahlen; ohne Jahr das juengste
Jahr mit Meldungen. Canonical mit ?page=N auf Folgeseiten, hreflang
nur auf Seite 1, CollectionPage + BreadcrumbList. Gecacht bis Seite 3.
Leere Jahre, unbekannte Kategorien, leere Folgeseiten: 404.
- Branchenseite: Jahresleiste unter dem Feed (archiveYears, eine
gruppierte Query); Sitemap listet alle Jahresarchive.
- categories:seed-descriptions {--dry-run} {--force}: fuellt leere DE/EN
Beschreibungen aus database/seeders/data/category-descriptions.php
(14 Kategorien, sachlich, ohne Werbeaussagen), leert den Seiten-Cache.
- Branchenseite: Titel trug config('app.name') ("– pressekonto") statt
des Portalnamens — jetzt presseecho/businessportal24.
- Protokoll Teil 5 (2.3 mit Befund: 0 von 14 Beschreibungen, Sonstiges =
28 % des Bestands), Roadmap 2.3 abgehakt.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b74f881ac8
commit
84ea617107
15 changed files with 793 additions and 13 deletions
|
|
@ -7,6 +7,7 @@ use App\Models\Category;
|
|||
use App\Models\Company;
|
||||
use App\Models\PressRelease;
|
||||
use App\Scopes\PortalScope;
|
||||
use App\Services\Web\CategoryArchivePageData;
|
||||
use App\Support\WebPortalContext;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
|
@ -76,18 +77,28 @@ class SitemapController extends Controller
|
|||
$urls[] = ['loc' => $base.'/de/'.$page, 'lastmod' => null];
|
||||
}
|
||||
|
||||
// Kategorien über die lokalisierten Slugs (CategoryTranslation).
|
||||
$categorySlugs = Category::query()
|
||||
// Kategorien über die lokalisierten Slugs (CategoryTranslation),
|
||||
// dazu je Kategorie die Jahresarchive (2.3).
|
||||
$categories = Category::query()
|
||||
->where('is_active', true)
|
||||
->whereIn('portal', $context->portalValues)
|
||||
->with('translations')
|
||||
->get()
|
||||
->map(fn (Category $category) => $category->translations->firstWhere('locale', 'de')?->slug)
|
||||
->filter()
|
||||
->unique();
|
||||
->with(['translations', 'children' => fn ($query) => $query->where('is_active', true)])
|
||||
->get();
|
||||
|
||||
foreach ($categories as $category) {
|
||||
$slug = $category->translations->firstWhere('locale', 'de')?->slug;
|
||||
|
||||
if (! $slug) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($categorySlugs as $slug) {
|
||||
$urls[] = ['loc' => $base.'/de/category/'.$slug, 'lastmod' => null];
|
||||
|
||||
$categoryIds = $category->children->pluck('id')->prepend($category->id)->unique()->values()->all();
|
||||
|
||||
foreach (array_keys(CategoryArchivePageData::yearsWithCounts($categoryIds, $context->portalValues, 'de')) as $year) {
|
||||
$urls[] = ['loc' => $base.'/de/category/'.$slug.'/archiv/'.$year, 'lastmod' => null];
|
||||
}
|
||||
}
|
||||
|
||||
// Öffentliche Newsrooms: aktive Firmen mit mindestens einer im Archiv
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue