Add sitemap

This commit is contained in:
Jade Ellis 2024-03-08 21:34:52 +00:00
parent 708dbc8355
commit b7996e5046
4 changed files with 15 additions and 0 deletions

View file

@ -28,6 +28,7 @@
"type": "module",
"dependencies": {
"@steeze-ui/svelte-icon": "^1.5.0",
"super-sitemap": "^0.14.14",
"xmlbuilder2": "^3.1.1"
}
}

View file

@ -0,0 +1,11 @@
// https://github.com/jasongitmail/super-sitemap/
import * as sitemap from 'super-sitemap';
import { SITE_URL } from '$lib/metadata';
import type { RequestHandler } from '@sveltejs/kit';
export const GET: RequestHandler = async ({ params }) => {
return await sitemap.response({
origin: SITE_URL,
page: params.page,
});
};

View file

@ -1,3 +1,6 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
Sitemap: https://jade.ellis.link/sitemap.xml