✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

SanitySitemapGenerator

By Roberto Malcotti

This tool is designed to automatically generate a sitemap powered by Sanity CMS with also the need to manage multiple languages.

About the project

Features

  • Fetches dynamic content types from Sanity CMS.
  • Generates a sitemap XML file compatible with search engine requirements.
  • Supports multilingual content for improved global SEO.

Configuration

Before running the script, make sure to configure the following variables according to your specific requirements: Adjust these settings in the script to match the specifics of your website and CMS setup.

baseUrl

This should be set to the base URL of your website. Example: const baseUrl = 'https://www.example.com';

docTypes

This array should include all the document types from your Sanity CMS that you want to include in the sitemap. Example: const docTypes = ["page", "business", "author", "blog", "event"];

Contributor

Other projects by author

SanityTranslator

Efficient Go middleware for seamless document translation within Sanity.io via DeepL API integration.

Roberto Malcotti
Go to SanityTranslator

Valpiccola

Valpiccola: Where Technology Celebrates Territorial Treasures!

Roberto Malcotti
Go to Valpiccola