feat: enhance domain handling for global representatives

- Updated `getStateInfo` to fetch site context for domains not in city.json, returning `repContext` with representative details.
- Implemented caching for site context requests to optimize performance.
- Modified doctor and clinic listing pages to pass the `domain` parameter when fetching data for global representatives.
- Adjusted metadata generation in layout and pages to reflect representative branding based on `repContext`.
- Added documentation for the new functionality in `.claude/prompt/global-rep-domain-site.md`.
This commit is contained in:
hamed
2026-07-09 07:34:09 +03:30
parent a56b7e8de5
commit ab2ab0dea2
12 changed files with 612 additions and 135 deletions
+5 -3
View File
@@ -16,7 +16,7 @@ export const viewport = {
};
export async function generateMetadata() {
const { matchedCity } = await getStateInfo();
const { matchedCity, repContext } = await getStateInfo();
const headersList = await headers();
const metadataBase = new URL(buildCanonicalUrl(headersList.get("host"), "/"));
@@ -27,7 +27,9 @@ export async function generateMetadata() {
matchedCity?.title ||
(matchedCity?.name
? `نوبت‌دهی آنلاین پزشکان ${matchedCity.name} | نوبت 724`
: "نوبت 724 | سیستم نوبت‌دهی آنلاین پزشکی");
: repContext?.full_name
? `نوبت‌دهی آنلاین پزشکان | ${repContext.full_name}`
: "نوبت 724 | سیستم نوبت‌دهی آنلاین پزشکی");
const description = matchedCity?.description || "نوبت 724 - سیستم آنلاین نوبت‌دهی برای پزشکان و کلینیک‌ها. با استفاده از نوبت 724، به راحتی نوبت پزشکی خود را به صورت آنلاین رزرو کنید و از خدمات سریع و کارآمد ما بهره‌مند شوید";
const baseMetadata = {
@@ -42,7 +44,7 @@ export async function generateMetadata() {
description,
type: "website",
locale: "fa_IR",
siteName: matchedCity?.site_name || "نوبت 724",
siteName: matchedCity?.site_name || repContext?.full_name || "نوبت 724",
images: ["https://nobat724.com/assets/images/logo.png"],
},
twitter: {