Skip to content

Commit 90eb885

Browse files
committed
Update metadata files
1 parent 631cd38 commit 90eb885

3 files changed

Lines changed: 42 additions & 42 deletions

File tree

next.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
33
transpilePackages: ["framer-motion"],
4-
output: "export",
4+
// output: "export",
5+
trailingSlash: true,
56
images: {
67
unoptimized: true,
78
remotePatterns: []

src/app/sitemap.js

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/app/sitemap.xml/route.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { cityData } from "@/data/cities";
2+
3+
export async function GET() {
4+
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || "https://pyday.vercel.app";
5+
6+
// Generar URLs
7+
const urls = [
8+
...['', '/multimedia', '/previous-editions', '/register', '/sponsors']
9+
.map(path => ({
10+
url: `${baseUrl}${path}`,
11+
lastModified: new Date().toISOString(),
12+
priority: path === '' ? 1.0 : 0.8,
13+
})),
14+
...Object.keys(cityData).map(citySlug => ({
15+
url: `${baseUrl}/${citySlug}`,
16+
lastModified: new Date().toISOString(),
17+
priority: 0.9,
18+
}))
19+
];
20+
21+
// Generar XML
22+
const xml = `<?xml version="1.0" encoding="UTF-8"?>
23+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
24+
${urls.map(({ url, lastModified, priority }) => `
25+
<url>
26+
<loc>${url}</loc>
27+
<lastmod>${lastModified}</lastmod>
28+
<changefreq>weekly</changefreq>
29+
<priority>${priority}</priority>
30+
</url>
31+
`).join('')}
32+
</urlset>`;
33+
34+
return new Response(xml, {
35+
headers: {
36+
'Content-Type': 'application/xml',
37+
'Cache-Control': 'public, s-maxage=86400, stale-while-revalidate=3600'
38+
},
39+
});
40+
}

0 commit comments

Comments
 (0)