From 1ed3d3dd9db3854130527ea388d753f2db6701dd Mon Sep 17 00:00:00 2001 From: Unchained Date: Thu, 9 Apr 2026 11:05:58 +0200 Subject: [PATCH] fix: update sitemap to use localized slugs for programmatic SEO pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update sitemap.ts to use page.localizedSlugs[locale] for correct URLs - Generate all 40 localized URLs (10 pages × 4 locales) with proper slugs - Remove outdated sitemap-programmatic.xml - Add proper TypeScript type for solutionPages --- sitemap-programmatic.xml | 243 --------------------------------------- src/app/sitemap.ts | 18 +-- 2 files changed, 10 insertions(+), 251 deletions(-) delete mode 100644 sitemap-programmatic.xml diff --git a/sitemap-programmatic.xml b/sitemap-programmatic.xml deleted file mode 100644 index 0b53992..0000000 --- a/sitemap-programmatic.xml +++ /dev/null @@ -1,243 +0,0 @@ - - - - https://manoonoils.com/solutions/arganovo-ulje-for-bore - weekly - 0.8 - - - - https://manoonoils.com/en/solutions/argan-oil-for-wrinkles - weekly - 0.8 - - - - https://manoonoils.com/de/solutions/arganoel-for-falten - weekly - 0.8 - - - - https://manoonoils.com/fr/solutions/huile-dargan-for-rides - weekly - 0.8 - - - - https://manoonoils.com/solutions/arganovo-ulje-for-suva-koza - weekly - 0.8 - - - - https://manoonoils.com/en/solutions/argan-oil-for-dry-skin - weekly - 0.8 - - - - https://manoonoils.com/de/solutions/arganoel-for-trockene-haut - weekly - 0.8 - - - - https://manoonoils.com/fr/solutions/huile-dargan-for-peau-seche - weekly - 0.8 - - - - https://manoonoils.com/solutions/arganovo-ulje-for-podocnjaci - weekly - 0.8 - - - - https://manoonoils.com/en/solutions/argan-oil-for-under-eye-bags - weekly - 0.8 - - - - https://manoonoils.com/de/solutions/arganoel-for-augenringe - weekly - 0.8 - - - - https://manoonoils.com/fr/solutions/huile-dargan-for-cernes - weekly - 0.8 - - - - https://manoonoils.com/solutions/ulje-divlje-ruze-for-bore - weekly - 0.8 - - - - https://manoonoils.com/en/solutions/rosehip-oil-for-wrinkles - weekly - 0.8 - - - - https://manoonoils.com/de/solutions/hagebuttenoel-for-falten - weekly - 0.8 - - - - https://manoonoils.com/fr/solutions/huile-de-rose-musquee-for-rides - weekly - 0.8 - - - - https://manoonoils.com/solutions/ulje-divlje-ruze-for-tamne-pjege - weekly - 0.8 - - - - https://manoonoils.com/en/solutions/rosehip-oil-for-dark-spots - weekly - 0.8 - - - - https://manoonoils.com/de/solutions/hagebuttenoel-for-dunkle-flecken - weekly - 0.8 - - - - https://manoonoils.com/fr/solutions/huile-de-rose-musquee-for-taches-sombres - weekly - 0.8 - - - - https://manoonoils.com/solutions/ulje-divlje-ruze-for-oziljci-od-akni - weekly - 0.8 - - - - https://manoonoils.com/en/solutions/rosehip-oil-for-acne-scars - weekly - 0.8 - - - - https://manoonoils.com/de/solutions/hagebuttenoel-for-aknenarben - weekly - 0.8 - - - - https://manoonoils.com/fr/solutions/huile-de-rose-musquee-for-cicatrices-dacne - weekly - 0.8 - - - - https://manoonoils.com/solutions/jojoba-ulje-for-akne - weekly - 0.8 - - - - https://manoonoils.com/en/solutions/jojoba-oil-for-acne - weekly - 0.8 - - - - https://manoonoils.com/de/solutions/jojobaoel-for-akne - weekly - 0.8 - - - - https://manoonoils.com/fr/solutions/huile-de-jojoba-for-acne - weekly - 0.8 - - - - https://manoonoils.com/solutions/jojoba-ulje-for-masna-koza - weekly - 0.8 - - - - https://manoonoils.com/en/solutions/jojoba-oil-for-oily-skin - weekly - 0.8 - - - - https://manoonoils.com/de/solutions/jojobaoel-for-fettige-haut - weekly - 0.8 - - - - https://manoonoils.com/fr/solutions/huile-de-jojoba-for-peau-grasse - weekly - 0.8 - - - - https://manoonoils.com/solutions/ulje-pasjeg-trna-for-hiperpigmentacija - weekly - 0.8 - - - - https://manoonoils.com/en/solutions/sea-buckthorn-oil-for-hyperpigmentation - weekly - 0.8 - - - - https://manoonoils.com/de/solutions/sanddornoel-for-hyperpigmentierung - weekly - 0.8 - - - - https://manoonoils.com/fr/solutions/huile-dargousier-for-hyperpigmentation - weekly - 0.8 - - - - https://manoonoils.com/solutions/ulje-slatkog-badema-for-osetljiva-koza - weekly - 0.8 - - - - https://manoonoils.com/en/solutions/sweet-almond-oil-for-sensitive-skin - weekly - 0.8 - - - - https://manoonoils.com/de/solutions/suessmandeloel-for-empfindliche-haut - weekly - 0.8 - - - - https://manoonoils.com/fr/solutions/huile-damande-douce-for-peau-sensible - weekly - 0.8 - - - \ No newline at end of file diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index f7727f0..94a1e74 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -1,6 +1,7 @@ import { MetadataRoute } from "next"; import { getProducts, filterOutBundles } from "@/lib/saleor"; import { getAllOilForConcernPages } from "@/lib/programmatic-seo/dataLoader"; +import type { OilForConcernPage } from "@/lib/programmatic-seo/types"; import { SUPPORTED_LOCALES, type Locale } from "@/lib/i18n/locales"; const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || "https://manoonoils.com"; @@ -106,7 +107,7 @@ export default async function sitemap(): Promise { } } - let solutionPages: any[] = []; + let solutionPages: OilForConcernPage[] = []; try { solutionPages = await getAllOilForConcernPages(); } catch (e) { @@ -116,16 +117,17 @@ export default async function sitemap(): Promise { const solutionUrls: SitemapEntry[] = []; for (const page of solutionPages) { - const hreflangs: Record = {}; for (const locale of SUPPORTED_LOCALES) { - const path = locale === "sr" ? `/solutions/${page.slug}` : `/${locale}/solutions/${page.slug}`; - hreflangs[locale] = `${baseUrl}${path}`; - } + const localizedSlug = page.localizedSlugs[locale]; + const url = `${baseUrl}/${locale}/solutions/${localizedSlug}`; + + const hreflangs: Record = {}; + for (const loc of SUPPORTED_LOCALES) { + hreflangs[loc] = `${baseUrl}/${loc}/solutions/${page.localizedSlugs[loc]}`; + } - for (const locale of SUPPORTED_LOCALES) { - const localePrefix = locale === "sr" ? "" : `/${locale}`; solutionUrls.push({ - url: `${baseUrl}${localePrefix}/solutions/${page.slug}`, + url, lastModified: new Date(), changeFrequency: "monthly", priority: 0.7,