feat: agregar rutas dinámicas para videos en la sección de ayuda

This commit is contained in:
2026-09-16 09:31:22 -03:00
parent 65d149a4e7
commit 583ddf1ea9
2 changed files with 297 additions and 1 deletions
+25 -1
View File
@@ -2,6 +2,7 @@ import { NextResponse } from "next/server";
import ApiServerService from "@core/Services/Api.Server.Service";
import { PublicServicesResults } from "@models/Service.model";
import { sliderFrames } from "@core/app/Services/SliderFrames";
import { getAllVideos } from "@core/app/landing/help/videoData";
export async function GET() {
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "https://turnosxpress.com.ar";
@@ -42,6 +43,25 @@ export async function GET() {
changeFrequency: "weekly",
priority: 0.8,
},
];
// Dynamic video routes (one per tutorial)
const allVideos = getAllVideos();
const videoRoutes: SitemapRoute[] = allVideos.map((video) => ({
url: `${baseUrl}/landing/help/video/${video.id}`,
changeFrequency: "monthly",
priority: 0.6,
images: [
{
url: video.thumbnail,
title: video.title,
caption: video.description,
},
],
}));
// Login and signup routes (lower priority)
const authRoutes: SitemapRoute[] = [
{
url: `${baseUrl}/landing/login`,
changeFrequency: "monthly",
@@ -52,6 +72,10 @@ export async function GET() {
changeFrequency: "monthly",
priority: 0.5,
},
];
// Marketing pages
const marketingRoutes: SitemapRoute[] = [
{
url: `${baseUrl}/landing/offer-appointments`,
changeFrequency: "weekly",
@@ -107,7 +131,7 @@ export async function GET() {
console.error("Error generating sitemap:", error);
}
const allRoutes = [...staticRoutes, ...serviceRoutes];
const allRoutes = [...staticRoutes, ...videoRoutes, ...authRoutes, ...marketingRoutes, ...serviceRoutes];
const sitemapXml = `<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"