From 7784d8eb7be39bd675872412def70b997b452d36 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 9 Feb 2025 15:02:12 +0100 Subject: [PATCH] update sitemap --- src/routes/sitemap.xml/+server.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/routes/sitemap.xml/+server.ts b/src/routes/sitemap.xml/+server.ts index d2309987..d12939d7 100644 --- a/src/routes/sitemap.xml/+server.ts +++ b/src/routes/sitemap.xml/+server.ts @@ -96,8 +96,12 @@ export async function GET({ locals }) { const articles = await pb.collection("articles").getFullList({ sort: "-created", }); + + const tutorials = await pb.collection("tutorials").getFullList({ + sort: "-created", + }); - const body = sitemap(stocks, articles, pages); + const body = sitemap(stocks, articles, pages, tutorials); const response = new Response(body); response.headers.set("Cache-Control", "max-age=0, s-maxage=3600"); response.headers.set("Content-Type", "application/xml"); @@ -109,6 +113,7 @@ const sitemap = ( stocks, articles, pages, + tutorials, ) => ` ` + + ${website}/learning-center/article/${convertToSlug(item?.title)} + + `, + ) + .join("")} ${stocks .map((ticker) => { // Determine the path based on the type of the ticker