Align storefront content URLs with live slug-based routes.

Use /blog/{slug}, /portfolio/{slug}, and /instruction/{slug} in sitemap defaults and emit CMS slugs for blogs/portfolios instead of title-derived paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-09-08 14:51:12 +03:30
co-authored by Cursor
parent 4823cf97f6
commit 9a020d748d
8 changed files with 25 additions and 20 deletions
+3 -3
View File
@@ -6,10 +6,10 @@ export const SITEMAP_URLSET_NS = 'http://www.sitemaps.org/schemas/sitemap/0.9';
export const DEFAULT_SITEMAP_PATH_TEMPLATES = {
product: '/products/{id}/{slug}',
productCategory: '/products/category/{id}/{slug}',
blog: '/blog/{id}/{slug}',
portfolio: '/portfolios/{id}/{slug}',
blog: '/blog/{slug}',
portfolio: '/portfolio/{slug}',
video: '/videos/{slug}',
instruction: '/instructions/{slug}',
instruction: '/instruction/{slug}',
workshop: '/workshops/{slug}',
userProduct: '/user-products/{slug}',
} as const;
+4 -5
View File
@@ -344,7 +344,7 @@ export class SitemapService {
},
select: {
id: true,
title: true,
slug: true,
updated_at: true,
},
orderBy: [{ updated_at: 'desc' }, { id: 'desc' }],
@@ -353,7 +353,7 @@ export class SitemapService {
return rows.map((row) =>
this.toEntry(baseUrl, template, {
id: row.id,
slug: slugifyForUrl(row.title, 'blog'),
slug: row.slug,
updatedAt: row.updated_at,
}),
);
@@ -371,8 +371,7 @@ export class SitemapService {
},
select: {
id: true,
title: true,
title_fa: true,
slug: true,
updated_at: true,
},
orderBy: [{ updated_at: 'desc' }, { id: 'desc' }],
@@ -381,7 +380,7 @@ export class SitemapService {
return rows.map((row) =>
this.toEntry(baseUrl, template, {
id: row.id,
slug: slugifyForUrl(row.title_fa || row.title, 'portfolio'),
slug: row.slug,
updatedAt: row.updated_at,
}),
);