How to render your sitemap.xml file in your Svelte/Sapper blog

zechtyounes on January 19, 2020

Repost from my personal blog. Hello everyone, I hope you're all doing well ! Today, I will show you a quick solution to render your sitemap.xml o... [Read Full]
Editor guide

I didn’t have to fetch the sitemap.xml as long as you have a anchor tag linking to it somewhere. Mine is in my footer. It’s pretty common practice to do this so others know you have a RSS feed.

I did something similar for my site khrome.dev

One thing the file based approach does not solve is if you use any of the dynamic routing, for example blog slugs.

So you may have to build that list separate and then manually call add those separate as you expand your site.

Really great write up though!


You taught me something, thank you 😄 !

PS: Your website looks very nice !


Thanks for this post!

I found that I wasn't able to implement this using a Svelte store. I use svelte-apollo to access my db, and what gets returned from the function is a store which seems not to play well with the sapper side of things...

Thankfully, I found a workaround, since I have another db that replicates the data I need (Algolia for search).

Here's a link to my implementation if anyone wants to see!





I should add this as well to my website! thanks for sharing


my pleasure 😋

Code of Conduct Report abuse