Files
biztaghavisite/next-sitemap.config.js
Ali Taghavi f08d3b1fde
Some checks failed
Deploy to VPS / deploy (push) Has been cancelled
phase3-4 done
2026-04-24 11:28:48 +03:30

34 lines
1.1 KiB
JavaScript

/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.NEXT_PUBLIC_SITE_URL || "https://biztaghavi.com",
generateRobotsTxt: true,
generateIndexSitemap: false,
changefreq: "weekly",
priority: 0.7,
exclude: ["/studio/*", "/api/*", "/en/studio/*"],
alternateRefs: [
{ href: "https://biztaghavi.com", hreflang: "fa" },
{ href: "https://biztaghavi.com/en", hreflang: "en" },
{ href: "https://biztaghavi.com", hreflang: "x-default" },
],
robotsTxtOptions: {
policies: [
{ userAgent: "*", allow: "/" },
{ userAgent: "*", disallow: ["/studio", "/api"] },
],
additionalSitemaps: [],
},
transform: async (config, path) => {
// Boost priority for key pages
const highPriority = ["/", "/en", "/about", "/en/about", "/writing", "/en/writing"];
const priority = highPriority.includes(path) ? 1.0 : config.priority;
return {
loc: path,
changefreq: config.changefreq,
priority,
lastmod: config.autoLastmod ? new Date().toISOString() : undefined,
alternateRefs: config.alternateRefs ?? [],
};
},
};