From 40b1da64bef924da7f43a324be81cd2a7fd2616c Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Tue, 18 Aug 2026 18:26:59 +0330 Subject: [PATCH] fix(seo): shorten the footer and center the related-solutions cards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- src/Shared/Landing/LandingRegistry.php | 23 +++++++++++++++++- templates/public/_footer.html.twig | 2 +- templates/public/landing.html.twig | 4 ++-- tests/Shared/LandingPageTest.php | 32 +++++++++++++++++++++++--- tests/Shared/LandingRegistryTest.php | 13 +++++++---- 5 files changed, 63 insertions(+), 11 deletions(-) diff --git a/src/Shared/Landing/LandingRegistry.php b/src/Shared/Landing/LandingRegistry.php index bb73c1ae..36a80467 100644 --- a/src/Shared/Landing/LandingRegistry.php +++ b/src/Shared/Landing/LandingRegistry.php @@ -29,12 +29,33 @@ final class LandingRegistry /** @var array|null ساخت تنبل؛ هر درخواست حداکثر یک بار می‌سازدش. */ private ?array $pages = null; + /** + * صفحه‌هایی که در فوتر می‌آیند. + * + * فوتر فهرست کامل نیست: با هر خوشهٔ کلیدواژهٔ تازه، ستونِ «راهکارها» بلندتر از + * بقیهٔ فوتر می‌شد و صفحه را زشت می‌کرد. بقیهٔ صفحه‌ها از بخش «راهکارهای دیگر» + * همین صفحه‌ها و از sitemap در دسترس‌اند — {@see LandingPageTest} تضمین می‌کند + * هیچ‌کدام از این فهرست جا نمانند. + * + * @var list + */ + private const FEATURED = [self::CLINIC, self::OFFICE, self::BOOKING, self::DENTAL, self::BEAUTY, self::FREE]; + /** @return array کلید = اسلاگ */ public function all(): array { return $this->pages ??= $this->build(); } + /** @return list صفحه‌های فوتر، به همان ترتیبِ تعریف‌شده */ + public function featured(): array + { + return array_values(array_filter(array_map( + fn (string $slug): ?LandingPage => $this->find($slug), + self::FEATURED, + ))); + } + public function find(string $slug): ?LandingPage { return $this->all()[$slug] ?? null; @@ -134,7 +155,7 @@ final class LandingRegistry ['q' => 'تداخل اتاق و دستگاه چطور کنترل می‌شود؟', 'a' => 'با تعریف منبع. نوبت علاوه بر وقت پزشک، وقت منبع را هم اشغال می‌کند.'], ['q' => 'گزارش مالی تفکیک‌شده دارد؟', 'a' => 'بله، فهرست پرداخت‌ها با وضعیت تسویه و خلاصهٔ مجموع، پرداخت‌شده و تسویه‌نشده.'], ], - related: [self::CLINIC, self::ACCOUNTING, self::DENTAL], + related: [self::CLINIC, self::ACCOUNTING, self::PHYSIOTHERAPY], ), new LandingPage( slug: self::FREE, diff --git a/templates/public/_footer.html.twig b/templates/public/_footer.html.twig index 940b759d..c81e2833 100644 --- a/templates/public/_footer.html.twig +++ b/templates/public/_footer.html.twig @@ -36,7 +36,7 @@