feat(seo): implement B2B dedicated route, structured data schemas, archive optimizations, and SEO database backfill
Deploy Canina / deploy (push) Successful in 1m44s
Deploy Canina / deploy (push) Successful in 1m44s
This commit is contained in:
1 parent
fa69aa4c49
commit
70c2627d93
26 files changed
+18570
-15327
No files matched your search
@@ -149,7 +149,10 @@ export class BlogsService {
|
||||
decodedSlug = rawSlug;
|
||||
}
|
||||
|
||||
const isUuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(decodedSlug);
|
||||
const isUuid =
|
||||
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
|
||||
decodedSlug,
|
||||
);
|
||||
|
||||
const blog = await this.prisma.blog.findFirst({
|
||||
where: {
|
||||
@@ -181,9 +184,17 @@ export class BlogsService {
|
||||
|
||||
// Fetch related products safely
|
||||
let relatedProducts: any[] = [];
|
||||
if (blog.relatedProductIds && Array.isArray(blog.relatedProductIds) && blog.relatedProductIds.length > 0) {
|
||||
if (
|
||||
blog.relatedProductIds &&
|
||||
Array.isArray(blog.relatedProductIds) &&
|
||||
blog.relatedProductIds.length > 0
|
||||
) {
|
||||
const validProductUuids = blog.relatedProductIds.filter(
|
||||
(id) => typeof id === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(id)
|
||||
(id) =>
|
||||
typeof id === 'string' &&
|
||||
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
|
||||
id,
|
||||
),
|
||||
);
|
||||
if (validProductUuids.length > 0) {
|
||||
try {
|
||||
@@ -208,9 +219,17 @@ export class BlogsService {
|
||||
|
||||
// Fetch related blogs safely
|
||||
let relatedBlogs: any[] = [];
|
||||
if (blog.relatedBlogIds && Array.isArray(blog.relatedBlogIds) && blog.relatedBlogIds.length > 0) {
|
||||
if (
|
||||
blog.relatedBlogIds &&
|
||||
Array.isArray(blog.relatedBlogIds) &&
|
||||
blog.relatedBlogIds.length > 0
|
||||
) {
|
||||
const validBlogUuids = blog.relatedBlogIds.filter(
|
||||
(id) => typeof id === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(id)
|
||||
(id) =>
|
||||
typeof id === 'string' &&
|
||||
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
|
||||
id,
|
||||
),
|
||||
);
|
||||
if (validBlogUuids.length > 0) {
|
||||
try {
|
||||
@@ -257,7 +276,10 @@ export class BlogsService {
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
console.warn('[BlogsService] Error fetching fallback related blogs:', err);
|
||||
console.warn(
|
||||
'[BlogsService] Error fetching fallback related blogs:',
|
||||
err,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user