Deploy Canina / deploy (push) Successful in 2m10s
- SEO-P1-07: extract FAQs and accordion items from blog content and inject JSON-LD FAQPage schema - SEO-P1-10: add dynamic sub-sitemaps /sitemap-blog.xml and /sitemap-wiki.xml and register in robots.ts - SEO-P2-16: host Lalezar font locally as optimized WOFF2 with preload enabled in lib/fonts.ts - Add full regression test suites with 100% pass rate
45 lines
983 B
TypeScript
45 lines
983 B
TypeScript
import { MetadataRoute } from 'next';
|
|
|
|
export default function robots(): MetadataRoute.Robots {
|
|
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://canina.ir';
|
|
const isStaging =
|
|
process.env.NEXT_PUBLIC_APP_ENV === 'staging' ||
|
|
process.env.NODE_ENV !== 'production' ||
|
|
baseUrl.includes('stage') ||
|
|
baseUrl.includes('test') ||
|
|
baseUrl.includes('dev');
|
|
|
|
if (isStaging) {
|
|
return {
|
|
rules: {
|
|
userAgent: '*',
|
|
disallow: '/',
|
|
},
|
|
};
|
|
}
|
|
|
|
return {
|
|
rules: {
|
|
userAgent: '*',
|
|
allow: '/',
|
|
disallow: [
|
|
'/dashboard/',
|
|
'/checkout/',
|
|
'/profile/',
|
|
'/api/',
|
|
'/*?*sort=',
|
|
'/*?*page=',
|
|
'/*?*order=',
|
|
'/track/',
|
|
],
|
|
},
|
|
sitemap: [
|
|
`${baseUrl}/sitemap.xml`,
|
|
`${baseUrl}/sitemap-products.xml`,
|
|
`${baseUrl}/sitemap-categories.xml`,
|
|
`${baseUrl}/sitemap-blog.xml`,
|
|
`${baseUrl}/sitemap-wiki.xml`,
|
|
],
|
|
};
|
|
}
|