okupter / kitforstartups

The Open Source SvelteKit SaaS boilerplate.
https://kitforstartups.com
MIT License
684 stars 31 forks source link

Add Sitemap #7

Open jasongitmail opened 9 months ago

jasongitmail commented 9 months ago

This is a cool project!

I noticed it needs a sitemap still for SEO. I recently created a package for SvelteKit called Super Sitemap (npm), to make this easy. Give it a look, and if you decide to use it, lmk if you have any questions. :)

Basic example below and advanced example.

// /src/routes/sitemap.xml/+server.ts
import * as sitemap from 'super-sitemap';
import type { RequestHandler } from '@sveltejs/kit';

export const GET: RequestHandler = async () => {
  return await sitemap.response({
    origin: 'https://example.com'
  });
};
JustinyAhin commented 9 months ago

Thank you for raising this @jasongitmail. Yes, sitemap is also on my list.

I'm thinking about setting up a demo site, to which I'd add the sitemap.

Your package looks awesome. I used to create the sitemaps manually, but it looks like this will make the whole thing way simpler.

jasongitmail commented 9 months ago

Glad to hear :)