@djangocfg/seo 2.1.411 → 2.1.413

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -1642,31 +1642,31 @@ function generateClaudeContext(report) {
1642
1642
  lines.push("");
1643
1643
  lines.push("**Required files in `app/`:**");
1644
1644
  lines.push("");
1645
- lines.push("### sitemap.xml/route.ts");
1645
+ lines.push("### sitemap.ts");
1646
1646
  lines.push("```typescript");
1647
- lines.push("import { createSitemapHandler } from '@djangocfg/nextjs/sitemap';");
1648
- lines.push("");
1649
- lines.push('export const dynamic = "force-static";');
1650
- lines.push("export const { GET } = createSitemapHandler({");
1651
- lines.push(" siteUrl,");
1652
- lines.push(" staticPages: [");
1653
- lines.push(' { loc: "/", priority: 1.0, changefreq: "daily" },');
1654
- lines.push(' { loc: "/about", priority: 0.8 },');
1647
+ lines.push("import { createDjangoSitemap } from '@djangocfg/nextjs/sitemap';");
1648
+ lines.push("");
1649
+ lines.push("const { generateSitemaps, sitemap } = createDjangoSitemap({");
1650
+ lines.push(" host: process.env.NEXT_PUBLIC_SITE_URL!,");
1651
+ lines.push(" // apiUrl: process.env.NEXT_PUBLIC_API_URL, // pulls /cfg/sitemap/* from Django");
1652
+ lines.push(" staticRoutes: [");
1653
+ lines.push(' { path: "/", changeFrequency: "daily", priority: 1.0 },');
1654
+ lines.push(' { path: "/about", changeFrequency: "weekly", priority: 0.8 },');
1655
1655
  lines.push(" ],");
1656
- lines.push(" dynamicPages: async () => fetchPagesFromAPI(),");
1657
1656
  lines.push("});");
1657
+ lines.push("");
1658
+ lines.push("export { generateSitemaps, sitemap as default };");
1659
+ lines.push("export const revalidate = 3600;");
1658
1660
  lines.push("```");
1659
1661
  lines.push("");
1660
1662
  lines.push("### robots.ts");
1661
1663
  lines.push("```typescript");
1662
- lines.push("import type { MetadataRoute } from 'next';");
1663
- lines.push("");
1664
- lines.push("export default function robots(): MetadataRoute.Robots {");
1665
- lines.push(" return {");
1666
- lines.push(' rules: { userAgent: "*", allow: "/" },');
1667
- lines.push(" sitemap: `${siteUrl}/sitemap.xml`,");
1668
- lines.push(" };");
1669
- lines.push("}");
1664
+ lines.push("import { createRobots } from '@djangocfg/nextjs/sitemap';");
1665
+ lines.push("");
1666
+ lines.push("export default createRobots({");
1667
+ lines.push(" host: process.env.NEXT_PUBLIC_SITE_URL!,");
1668
+ lines.push(' disallow: ["/account/", "/auth", "/api/"],');
1669
+ lines.push("});");
1670
1670
  lines.push("```");
1671
1671
  lines.push("");
1672
1672
  lines.push("### Cloudflare Override");