Seobility-Crawl 2: Karten-Links, Platzhalter-News, Titel-Kontext ueber Ordner, Descriptions 155 Zeichen
Migration crawl2_fixes_20261110 (angewendet): sechs Karten-Buttons zeigten auf versteckte/geloeschte Produkt-URLs (ArtioSign/ArtioView -> /products/aetria, Redirects folgen; X-View-Selbstlink entfernt; Chassis-Karte auf das verbliebene Produkt). Drei weitere News trugen noch den InfoComm-Importplatzhalter und doppelten echte Artikel (JODDB, Bluefin, NAB 2026) -> geloescht + 301; EKOM-Artikel bekommt seinen Text von der alten /en/news-Seite; byte-identische Datapath- Kopie (#551) -> 301. Drei Tippfehler. Tote vitec.com-Links in 14 Datensaetzen auf interne Ziele (/markets, /insights/sustainability, Story Northwestern, /product/fx4, 'vitec.com./' und ' '-Links). SEO-Titel fuer sieben Hauptseiten, Descriptions fuer neun Kategorieseiten mit < 60 Zeichen. VitecMetaHandler: Titel-Kontext ueberspringt Ordner-/Shortcut-Ebenen ('End-Points | Products | VITEC' statt 'End-Points | VITEC'); kurze Story-Titel bekommen '| Success Story'; Meta-Description auf 155 Zeichen gekappt, auch redaktionelle (Seobility: 527 'zu lang'). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
4b6731786d
commit
e357f42b81
2 files changed
+326
-13
No files matched your search
@@ -123,6 +123,11 @@ class VitecMetaHandler extends MetaHandler
|
||||
if ($recordTitle !== '') {
|
||||
$title = $recordTitle;
|
||||
}
|
||||
// "Betfred HQ | VITEC" is too short to say what the page is.
|
||||
$storyCore = trim((string)preg_replace('/\s*[|\x{2013}\-]\s*vitec\s*$/iu', '', $title));
|
||||
if ($storyCore !== '' && mb_strlen($storyCore) < 30 && mb_stripos($storyCore, 'success story') === false) {
|
||||
$title = $storyCore . ' | Success Story';
|
||||
}
|
||||
$description = trim((string)($usecase['seo_description'] ?? ''));
|
||||
if ($description === '') {
|
||||
$description = trim((string)($usecase['og_description'] ?? ''));
|
||||
@@ -182,12 +187,19 @@ class VitecMetaHandler extends MetaHandler
|
||||
|
||||
// --- compose meta list ------------------------------------------------
|
||||
$meta = is_array($content['seo']['meta'] ?? null) ? $content['seo']['meta'] : [];
|
||||
$description = $this->crop($description, 300);
|
||||
// ~155 characters is what search engines show (Seobility: 527 "zu lang").
|
||||
$description = $this->crop($description, 155);
|
||||
$absImage = $image !== '' ? $this->absolute($image, $base) : '';
|
||||
|
||||
if ($description !== '' && !$this->hasMeta($meta, 'name', 'description')) {
|
||||
$meta[] = ['name' => 'description', 'content' => $description];
|
||||
}
|
||||
// Editorial descriptions already in the list get the same length cap.
|
||||
foreach ($meta as $index => $entry) {
|
||||
if (($entry['name'] ?? '') === 'description' && is_string($entry['content'] ?? null)) {
|
||||
$meta[$index]['content'] = $this->crop(trim($entry['content']), 155);
|
||||
}
|
||||
}
|
||||
$finalDescription = $this->metaContent($meta, 'name', 'description');
|
||||
if ($finalDescription === '') {
|
||||
$finalDescription = $description;
|
||||
@@ -267,22 +279,27 @@ class VitecMetaHandler extends MetaHandler
|
||||
return '';
|
||||
}
|
||||
// Rootline keys are the depth (0 = root), but the array is krsort()ed
|
||||
// (current page first). Sort by depth and take the entry before last.
|
||||
// (current page first). Walk up from the parent, skipping structural
|
||||
// levels (folders, shortcuts, spacers, technical names) until a page
|
||||
// with a presentable name turns up; the site root never counts.
|
||||
$rootLine = $pageInfo->getRootLine();
|
||||
ksort($rootLine);
|
||||
$byDepth = array_values($rootLine);
|
||||
$parent = count($byDepth) >= 3 ? ($byDepth[count($byDepth) - 2] ?? null) : null;
|
||||
if (!is_array($parent)) {
|
||||
return '';
|
||||
for ($i = count($byDepth) - 2; $i >= 1; $i--) {
|
||||
$candidate = $byDepth[$i];
|
||||
if (!is_array($candidate)) {
|
||||
continue;
|
||||
}
|
||||
if (in_array((int)($candidate['doktype'] ?? 1), [3, 4, 199, 254, 255], true)) {
|
||||
continue;
|
||||
}
|
||||
$name = trim((string)($candidate['nav_title'] ?? '')) ?: trim((string)($candidate['title'] ?? ''));
|
||||
if ($name === '' || preg_match('/^user[_ -]?nav$/i', $name) === 1 || str_contains($name, '_')) {
|
||||
continue;
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
if (in_array((int)($parent['doktype'] ?? 1), [3, 4, 199, 254, 255], true)) {
|
||||
return '';
|
||||
}
|
||||
$name = trim((string)($parent['nav_title'] ?? '')) ?: trim((string)($parent['title'] ?? ''));
|
||||
if ($name === '' || preg_match('/^user[_ -]?nav$/i', $name) === 1 || str_contains($name, '_')) {
|
||||
return '';
|
||||
}
|
||||
return $name;
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user