From aaa2d7ae4a756f8586a375fd149c333af9874b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Wed, 4 Jun 2025 17:12:17 -0300 Subject: [PATCH] Add sitemap --- src/routes/sitemap.xml/+server.js | 41 +++++++++++++++++++++++++++++++ static/robots.txt | 2 ++ 2 files changed, 43 insertions(+) create mode 100644 src/routes/sitemap.xml/+server.js create mode 100644 static/robots.txt diff --git a/src/routes/sitemap.xml/+server.js b/src/routes/sitemap.xml/+server.js new file mode 100644 index 0000000..d0bf653 --- /dev/null +++ b/src/routes/sitemap.xml/+server.js @@ -0,0 +1,41 @@ +export async function GET() { + const baseUrl = 'https://embroideryviewer.xyz'; + + const pages = [ + '', + 'about', + 'donate', + 'terms-of-service', + 'privacy-policy', + 'viewer', + ]; + + const urls = pages + .map( + (page) => ` + + ${baseUrl}/${page} + weekly + 0.8 + `, + ) + .join(''); + + const xml = ` + + ${urls} + `.trim(); + + return new Response(xml, { + headers: { + 'Content-Type': 'application/xml', + }, + }); +} diff --git a/static/robots.txt b/static/robots.txt new file mode 100644 index 0000000..deba89c --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Sitemap: https://www.embroideryviewer.xyz/sitemap.xml \ No newline at end of file