Skip to main content
Starter Kit - Ships with your template. You own it - modify freely.

Overview

The sitemap ensemble generates XML sitemaps that help search engines discover and index your content. It serves a standards-compliant XML sitemap at /sitemap.xml that includes URL locations, last modification dates, change frequencies, and priority values. The ensemble uses the Liquid template engine to render the sitemap XML, making it easy to customize the output format while maintaining XML standards compliance.

Endpoint

The sitemap is publicly accessible and returns XML content with the proper application/xml content type. Both HTML and JSON response formats are disabled since sitemaps must be served as XML.

URL Configuration

Each URL in the sitemap supports the following fields:

Full Ensemble YAML

Static URLs Example

The default configuration includes static URLs as examples. To customize for your site:
Replace https://yoursite.com with your actual domain and add all your important pages.

Dynamic Generation from D1 Database

For applications with dynamic content (blog posts, products, documentation), generate the sitemap from your database:

Database Schema

Your D1 database should have a table with at least these columns:
Example records:

Customization

Add Change Frequency from Database

Include changefreq in your query and template:

Multiple Content Types

Combine different content types (pages, blog posts, products):
Handler file handlers/combine-sitemap.ts:

Cache the Sitemap

Add caching to reduce database queries:

Robots.txt

Configure robots.txt to reference your sitemap