Skip to content

Commit 631cd38

Browse files
committed
Update metadata files
1 parent cbc6a3c commit 631cd38

3 files changed

Lines changed: 37 additions & 25 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"dev": "next dev --turbopack",
7-
"build": "next build --turbopack",
7+
"build": "next build",
88
"export": "next export",
99
"start": "next start",
1010
"lint": "next lint"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# robots.txt para PyDay Chile
2-
# https://pyday.vercel.app/
2+
# https://pyday.web.app/
33

44
# Permitir a todos los robots de búsqueda
55
User-agent: *
@@ -18,7 +18,7 @@ Allow: /register
1818
Allow: /sponsors
1919

2020
# Dirección del sitemap
21-
Sitemap: https://pyday.vercel.app//sitemap.xml
21+
Sitemap: https://pyday.web.app//sitemap.xml
2222

2323
# Velocidad de rastreo para Google
2424
User-agent: Googlebot

src/app/sitemap.js

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
1-
import cityData from "@/data/cities";
1+
import { cityData } from "@/data/cities";
2+
3+
export const dynamic = 'force-dynamic';
4+
5+
export async function GET() {
6+
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || "https://pyday.vercel.app";
27

3-
export default async function sitemap() {
4-
const baseUrl = "https://pyday.vercel.app/";
5-
68
// Rutas estáticas
79
const staticRoutes = [
8-
'',
9-
'/multimedia',
10-
'/previous-editions',
11-
'/register',
12-
'/sponsors',
13-
].map(route => ({
14-
url: `${baseUrl}${route}`,
15-
lastModified: new Date(),
16-
changeFrequency: 'weekly',
17-
priority: route === '' ? 1.0 : 0.8,
18-
}));
19-
20-
// Rutas dinámicas basadas en ciudades
10+
{ path: '', priority: 1.0 },
11+
{ path: '/multimedia', priority: 0.8 },
12+
{ path: '/previous-editions', priority: 0.8 },
13+
{ path: '/register', priority: 0.8 },
14+
{ path: '/sponsors', priority: 0.8 },
15+
];
16+
17+
// Rutas dinámicas de ciudades
2118
const citiesRoutes = Object.keys(cityData).map(citySlug => ({
22-
url: `${baseUrl}/${citySlug}`,
23-
lastModified: new Date(),
24-
changeFrequency: 'weekly',
19+
path: `/${citySlug}`,
2520
priority: 0.9,
2621
}));
27-
28-
return [...staticRoutes, ...citiesRoutes];
22+
23+
// Generar XML
24+
const xml = `<?xml version="1.0" encoding="UTF-8"?>
25+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
26+
${[...staticRoutes, ...citiesRoutes].map(({ path, priority }) => `
27+
<url>
28+
<loc>${baseUrl}${path}</loc>
29+
<lastmod>${new Date().toISOString()}</lastmod>
30+
<changefreq>weekly</changefreq>
31+
<priority>${priority}</priority>
32+
</url>
33+
`).join('')}
34+
</urlset>`;
35+
36+
return new Response(xml, {
37+
headers: {
38+
'Content-Type': 'application/xml',
39+
},
40+
});
2941
}

0 commit comments

Comments
 (0)