feat: agregar rutas dinámicas para videos en la sección de ayuda
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user