Sitemap generator for SvelteKit. Small helper which scans your SvelteKit routes and generates static sitemap.xml
The Svelte sitemap.xml generator is a small helper tool designed for SvelteKit adapter-static with prerender option (SSG). It scans your Svelte routes and generates a sitemap.xml file for your website. It supports TypeScript and JavaScript, and can be used as a CLI tool or directly from your code. It also provides useful options for customizing your sitemap and integrates with Google Search Console.
Designed for SvelteKit adapter-static with prerender option (SSG): This tool is specifically designed for use with SvelteKit adapter-static and supports prerendering of pages.
Support for TypeScript, JavaScript, CLI version: The tool supports both TypeScript and JavaScript, and can be used as a CLI tool or directly from your code.
Useful options for customizing your sitemap: The tool provides various options for customizing your sitemap, such as setting a custom build folder, ignoring files or folders, adding trailing slashes, setting the lastModified time, and setting the change frequency.
Support for submitting sitemap to Google Search Console: The tool integrates with Google Search Console, allowing you to easily submit your sitemap for indexing.
Support for Google sitemap index: If you have a large website with more than 50,000 pages, the tool supports generating a Google sitemap index, which helps with efficiently managing and indexing large sites.
Compatible with Vercel hosting: The tool is compatible with Vercel hosting, making it easy to generate and manage your sitemap for SvelteKit projects hosted on Vercel.
Workaround for official SvelteKit issue: The tool provides a workaround for an official SvelteKit issue, ensuring that your sitemap generation process runs smoothly.
To install the Svelte sitemap.xml generator, you can follow these steps:
"scripts": {
"postbuild": "svelte-sitemap-generator"
}
npm install svelte-sitemap-generator
"scripts": {
"postbuild": "svelte-sitemap-generator --domain https://mydomain.com --out-dir dist"
}
The Svelte sitemap.xml generator is a useful tool for generating sitemap.xml files for SvelteKit projects using the adapter-static with prerender option. It provides various customization options and integrates with Google Search Console for easy submission. With its compatibility with Vercel hosting and workaround for official SvelteKit issues, it offers a convenient solution for managing and generating sitemaps for SvelteKit websites.