Dynamic Sitemap

Dynamic Sitemap in Sveltekit.

Sat Jun 03 2023

I started thinking about SEO, and now that I’m on the SvelteKit train, I was curious about how to generate a dynamic sitemap. Coming from VueJS and Nuxt, I was used to having a package to handle it (@nuxtjs/sitemap). It seems like in SvelteKit, it’s more DIY, which I actually prefer because I’m happier with fewer dependencies at this point. I wanted an example to start from and found a great one by Scott Spence.

Scott is using a different SvelteKit blog template than the one I used to start this one, so mine is just a tad different, but it worked out great! The blog template this site is based on is from Mehdi Vasigh. Thanks Mehdi!

If you want to look at the Svelte/MDsveX Blog Template Scott uses, you can head to Matt Jennings’ Github. It looks excellent; the one I used just suits my needs better because I wanted something completely bare bones.