fix: update sitemap to use localized slugs for programmatic SEO pages

- 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
This commit is contained in:
Unchained
2026-04-09 11:05:58 +02:00
parent 14d7a3e21a
commit 1ed3d3dd9d
2 changed files with 10 additions and 251 deletions

View File

@@ -1,243 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://manoonoils.com/solutions/arganovo-ulje-for-bore</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="sr" href="https://manoonoils.com/solutions/arganovo-ulje-for-bore" />
</url>
<url>
<loc>https://manoonoils.com/en/solutions/argan-oil-for-wrinkles</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="en" href="https://manoonoils.com/en/solutions/argan-oil-for-wrinkles" />
</url>
<url>
<loc>https://manoonoils.com/de/solutions/arganoel-for-falten</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="de" href="https://manoonoils.com/de/solutions/arganoel-for-falten" />
</url>
<url>
<loc>https://manoonoils.com/fr/solutions/huile-dargan-for-rides</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="fr" href="https://manoonoils.com/fr/solutions/huile-dargan-for-rides" />
</url>
<url>
<loc>https://manoonoils.com/solutions/arganovo-ulje-for-suva-koza</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="sr" href="https://manoonoils.com/solutions/arganovo-ulje-for-suva-koza" />
</url>
<url>
<loc>https://manoonoils.com/en/solutions/argan-oil-for-dry-skin</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="en" href="https://manoonoils.com/en/solutions/argan-oil-for-dry-skin" />
</url>
<url>
<loc>https://manoonoils.com/de/solutions/arganoel-for-trockene-haut</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="de" href="https://manoonoils.com/de/solutions/arganoel-for-trockene-haut" />
</url>
<url>
<loc>https://manoonoils.com/fr/solutions/huile-dargan-for-peau-seche</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="fr" href="https://manoonoils.com/fr/solutions/huile-dargan-for-peau-seche" />
</url>
<url>
<loc>https://manoonoils.com/solutions/arganovo-ulje-for-podocnjaci</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="sr" href="https://manoonoils.com/solutions/arganovo-ulje-for-podocnjaci" />
</url>
<url>
<loc>https://manoonoils.com/en/solutions/argan-oil-for-under-eye-bags</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="en" href="https://manoonoils.com/en/solutions/argan-oil-for-under-eye-bags" />
</url>
<url>
<loc>https://manoonoils.com/de/solutions/arganoel-for-augenringe</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="de" href="https://manoonoils.com/de/solutions/arganoel-for-augenringe" />
</url>
<url>
<loc>https://manoonoils.com/fr/solutions/huile-dargan-for-cernes</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="fr" href="https://manoonoils.com/fr/solutions/huile-dargan-for-cernes" />
</url>
<url>
<loc>https://manoonoils.com/solutions/ulje-divlje-ruze-for-bore</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="sr" href="https://manoonoils.com/solutions/ulje-divlje-ruze-for-bore" />
</url>
<url>
<loc>https://manoonoils.com/en/solutions/rosehip-oil-for-wrinkles</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="en" href="https://manoonoils.com/en/solutions/rosehip-oil-for-wrinkles" />
</url>
<url>
<loc>https://manoonoils.com/de/solutions/hagebuttenoel-for-falten</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="de" href="https://manoonoils.com/de/solutions/hagebuttenoel-for-falten" />
</url>
<url>
<loc>https://manoonoils.com/fr/solutions/huile-de-rose-musquee-for-rides</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="fr" href="https://manoonoils.com/fr/solutions/huile-de-rose-musquee-for-rides" />
</url>
<url>
<loc>https://manoonoils.com/solutions/ulje-divlje-ruze-for-tamne-pjege</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="sr" href="https://manoonoils.com/solutions/ulje-divlje-ruze-for-tamne-pjege" />
</url>
<url>
<loc>https://manoonoils.com/en/solutions/rosehip-oil-for-dark-spots</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="en" href="https://manoonoils.com/en/solutions/rosehip-oil-for-dark-spots" />
</url>
<url>
<loc>https://manoonoils.com/de/solutions/hagebuttenoel-for-dunkle-flecken</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="de" href="https://manoonoils.com/de/solutions/hagebuttenoel-for-dunkle-flecken" />
</url>
<url>
<loc>https://manoonoils.com/fr/solutions/huile-de-rose-musquee-for-taches-sombres</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="fr" href="https://manoonoils.com/fr/solutions/huile-de-rose-musquee-for-taches-sombres" />
</url>
<url>
<loc>https://manoonoils.com/solutions/ulje-divlje-ruze-for-oziljci-od-akni</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="sr" href="https://manoonoils.com/solutions/ulje-divlje-ruze-for-oziljci-od-akni" />
</url>
<url>
<loc>https://manoonoils.com/en/solutions/rosehip-oil-for-acne-scars</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="en" href="https://manoonoils.com/en/solutions/rosehip-oil-for-acne-scars" />
</url>
<url>
<loc>https://manoonoils.com/de/solutions/hagebuttenoel-for-aknenarben</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="de" href="https://manoonoils.com/de/solutions/hagebuttenoel-for-aknenarben" />
</url>
<url>
<loc>https://manoonoils.com/fr/solutions/huile-de-rose-musquee-for-cicatrices-dacne</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="fr" href="https://manoonoils.com/fr/solutions/huile-de-rose-musquee-for-cicatrices-dacne" />
</url>
<url>
<loc>https://manoonoils.com/solutions/jojoba-ulje-for-akne</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="sr" href="https://manoonoils.com/solutions/jojoba-ulje-for-akne" />
</url>
<url>
<loc>https://manoonoils.com/en/solutions/jojoba-oil-for-acne</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="en" href="https://manoonoils.com/en/solutions/jojoba-oil-for-acne" />
</url>
<url>
<loc>https://manoonoils.com/de/solutions/jojobaoel-for-akne</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="de" href="https://manoonoils.com/de/solutions/jojobaoel-for-akne" />
</url>
<url>
<loc>https://manoonoils.com/fr/solutions/huile-de-jojoba-for-acne</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="fr" href="https://manoonoils.com/fr/solutions/huile-de-jojoba-for-acne" />
</url>
<url>
<loc>https://manoonoils.com/solutions/jojoba-ulje-for-masna-koza</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="sr" href="https://manoonoils.com/solutions/jojoba-ulje-for-masna-koza" />
</url>
<url>
<loc>https://manoonoils.com/en/solutions/jojoba-oil-for-oily-skin</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="en" href="https://manoonoils.com/en/solutions/jojoba-oil-for-oily-skin" />
</url>
<url>
<loc>https://manoonoils.com/de/solutions/jojobaoel-for-fettige-haut</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="de" href="https://manoonoils.com/de/solutions/jojobaoel-for-fettige-haut" />
</url>
<url>
<loc>https://manoonoils.com/fr/solutions/huile-de-jojoba-for-peau-grasse</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="fr" href="https://manoonoils.com/fr/solutions/huile-de-jojoba-for-peau-grasse" />
</url>
<url>
<loc>https://manoonoils.com/solutions/ulje-pasjeg-trna-for-hiperpigmentacija</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="sr" href="https://manoonoils.com/solutions/ulje-pasjeg-trna-for-hiperpigmentacija" />
</url>
<url>
<loc>https://manoonoils.com/en/solutions/sea-buckthorn-oil-for-hyperpigmentation</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="en" href="https://manoonoils.com/en/solutions/sea-buckthorn-oil-for-hyperpigmentation" />
</url>
<url>
<loc>https://manoonoils.com/de/solutions/sanddornoel-for-hyperpigmentierung</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="de" href="https://manoonoils.com/de/solutions/sanddornoel-for-hyperpigmentierung" />
</url>
<url>
<loc>https://manoonoils.com/fr/solutions/huile-dargousier-for-hyperpigmentation</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="fr" href="https://manoonoils.com/fr/solutions/huile-dargousier-for-hyperpigmentation" />
</url>
<url>
<loc>https://manoonoils.com/solutions/ulje-slatkog-badema-for-osetljiva-koza</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="sr" href="https://manoonoils.com/solutions/ulje-slatkog-badema-for-osetljiva-koza" />
</url>
<url>
<loc>https://manoonoils.com/en/solutions/sweet-almond-oil-for-sensitive-skin</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="en" href="https://manoonoils.com/en/solutions/sweet-almond-oil-for-sensitive-skin" />
</url>
<url>
<loc>https://manoonoils.com/de/solutions/suessmandeloel-for-empfindliche-haut</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="de" href="https://manoonoils.com/de/solutions/suessmandeloel-for-empfindliche-haut" />
</url>
<url>
<loc>https://manoonoils.com/fr/solutions/huile-damande-douce-for-peau-sensible</loc>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
<xhtml:link rel="alternate" hreflang="fr" href="https://manoonoils.com/fr/solutions/huile-damande-douce-for-peau-sensible" />
</url>
</urlset>

View File

@@ -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<SitemapEntry[]> {
}
}
let solutionPages: any[] = [];
let solutionPages: OilForConcernPage[] = [];
try {
solutionPages = await getAllOilForConcernPages();
} catch (e) {
@@ -116,16 +117,17 @@ export default async function sitemap(): Promise<SitemapEntry[]> {
const solutionUrls: SitemapEntry[] = [];
for (const page of solutionPages) {
const hreflangs: Record<string, string> = {};
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<string, string> = {};
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,