fix(seo): shorten the footer and center the related-solutions cards

Every landing page was listed in the footer, so adding keyword clusters made
that one column taller than the rest of the footer put together. It now lists
six — the head terms and the two biggest specialties — and the rest stay
reachable through the "other solutions" block each page already renders.

That trade only holds if nothing falls out of the link graph, so the old test
asserting "the footer links to every page" is replaced by one that walks the
related-page graph from the footer links and fails when any page is not
reachable. Physiotherapy was the one page that would have been orphaned; the
polyclinic page now links to it.

The related-solutions heading said "for your trade", which reads oddly for the
clinics it is addressing, and its cards were left-aligned in a centered
section.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
hamed
2026-08-18 18:26:59 +03:30
co-authored by Claude Opus 5
parent 8e4bb3ca7b
commit 40b1da64be
5 changed files with 63 additions and 11 deletions
+29 -3
View File
@@ -94,17 +94,43 @@ class LandingPageTest extends WebTestCase
}
/** بدون لینک داخلی، صفحات فقط از sitemap دیده می‌شوند. */
public function testFooterLinksToEveryLandingOnEveryPage(): void
public function testFooterLinksToTheFeaturedLandingsOnEveryPage(): void
{
foreach (['/', '/' . LandingRegistry::CRM] as $path) {
$html = $this->html($path);
foreach (array_keys($this->registry->all()) as $slug) {
self::assertStringContainsString('href="/' . $slug . '"', $html, "لینک «{$slug}» در {$path} نیست");
foreach ($this->registry->featured() as $page) {
self::assertStringContainsString('href="/' . $page->slug . '"', $html, "لینک «{$page->slug}» در {$path} نیست");
}
}
}
/**
* فوتر دیگر همهٔ صفحه‌ها را فهرست نمی‌کند، پس باید ثابت بماند که از همان چند
* لینکِ فوتر، با دنبال‌کردن «راهکارهای دیگر»، به هر صفحه می‌رسیم. صفحه‌ای که فقط
* در sitemap باشد عملاً بدون لینک داخلی است و رتبه نمی‌گیرد.
*/
public function testEveryLandingIsReachableFromTheFooterLinks(): void
{
$pages = $this->registry->all();
$queue = array_map(static fn ($page): string => $page->slug, $this->registry->featured());
$reached = array_flip($queue);
while ($queue !== []) {
$slug = array_shift($queue);
foreach ($pages[$slug]->related as $next) {
if (!isset($reached[$next])) {
$reached[$next] = true;
$queue[] = $next;
}
}
}
foreach (array_keys($pages) as $slug) {
self::assertArrayHasKey($slug, $reached, "«{$slug}» از هیچ صفحه‌ای لینک نمی‌گیرد");
}
}
public function testStructuredDataIsValidJson(): void
{
foreach (array_keys($this->registry->all()) as $slug) {
+9 -4
View File
@@ -27,12 +27,17 @@ class LandingRegistryTest extends TestCase
// تعداد صفحه‌ها با هر خوشهٔ کلیدواژهٔ تازه بالا می‌رود، پس عدد ثابت اینجا فقط
// یک تستِ شکننده می‌سازد. آنچه باید ثابت بماند این است که هر ثابتِ کلاس
// واقعاً صفحه‌ای دارد — ثابتی که ساخته نشده باشد، لینک داخلیِ ۴۰۴ می‌سازد.
$constants = (new \ReflectionClass(LandingRegistry::class))->getConstants();
// فقط ثابت‌های عمومی: اسلاگ‌ها همان‌هایند و ثابت‌های داخلی (مثل فهرست فوتر)
// صفحه نیستند.
foreach ((new \ReflectionClass(LandingRegistry::class))->getReflectionConstants() as $constant) {
if (!$constant->isPublic()) {
continue;
}
self::assertSame(count($constants), count($slugs));
foreach ($constants as $name => $slug) {
self::assertContains($slug, $slugs, "ثابت {$name} صفحه‌ای ندارد");
self::assertContains($constant->getValue(), $slugs, "ثابت {$constant->getName()} صفحه‌ای ندارد");
}
self::assertCount(count($slugs), array_unique($slugs));
}
public function testUnknownSlugReturnsNull(): void