feat(sitemap): refactor sitemap generation to include doctors, clinics, and blogs with improved URL handling

This commit is contained in:
hamed
2026-06-21 12:52:41 +03:30
parent a8c3a57114
commit cb9d9beaab
6 changed files with 98 additions and 141 deletions
+3 -3
View File
@@ -47,7 +47,7 @@ export async function generateMetadata({ params }) {
const description =
doctor.detail ||
`رزرو نوبت آنلاین دکتر ${doctor.name}${specialtyNames ? " متخصص " + specialtyNames : ""}${doctor.address ? " | " + doctor.address : ""}`.trim();
const image = imageUrl(doctor.img) || FALLBACK_IMG;
const image = imageUrl(doctor.img?.[0]?.url) || FALLBACK_IMG;
return {
title,
@@ -103,10 +103,10 @@ async function Doctor({ params }) {
name: `دکتر ${doctor.name}`,
url: `https://www.nobat724.com/doctor/${doctor.uuid}`,
...(specialtyNames && { medicalSpecialty: specialtyNames }),
...(doctor.img && {
...(doctor.img?.[0]?.url && {
image: {
"@type": "ImageObject",
url: imageUrl(doctor.img),
url: imageUrl(doctor.img[0].url),
},
}),
...(Number(doctor.point) > 0 && {