feat: add canonical URL handling and entity quality checks
- Implemented canonical URL strategies for city-specific domains and entities. - Added helper functions for domain and city resolution. - Created tests for canonical URL generation and domain resolution. - Introduced entity quality checks for doctors and clinics to ensure meaningful content. - Developed unique introductory texts for listing pages to avoid duplicate content. - Established robots.txt policies for listing pages to manage indexing based on user filters. - Enhanced specialty content with dynamic introductions and FAQs to improve SEO.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// سیاست ایندکس صفحات لیست (/doctors و /clinics) — یک پیادهسازی مشترک تا دو مسیر واگرا نشوند.
|
||||
//
|
||||
// جستجوی داخلی (name) و ترکیب چند فیلتر واقعی نباید ایندکس شوند (crawl budget و duplicate).
|
||||
// اما city/state روی دامنههای شهری خودکار از host تزریق میشوند و «فیلتر انتخابی کاربر»
|
||||
// نیستند؛ شمردنشان باعث میشد صفحهٔ اصلی لیست روی هر ۳۵ دامنه همیشه noindex شود.
|
||||
|
||||
const USER_FILTER_KEYS = ["specialty", "gender", "degree", "active", "sort"];
|
||||
|
||||
export function listingRobots(params, { matchedCity, matchedState } = {}) {
|
||||
if (params?.name) return { robots: { index: false, follow: true } };
|
||||
|
||||
const activeFilters = USER_FILTER_KEYS.filter((key) => params?.[key]);
|
||||
|
||||
// فقط city/state متفاوت از شهر/استانِ همین دامنه، انتخاب صریح کاربر است.
|
||||
if (params?.city && params.city !== matchedCity?.name) activeFilters.push("city");
|
||||
if (params?.state && params.state !== matchedState?.name) activeFilters.push("state");
|
||||
|
||||
if (activeFilters.length >= 2) return { robots: { index: false, follow: true } };
|
||||
return {};
|
||||
}
|
||||
Reference in New Issue
Block a user