#@astrojs/sitemap with live content collections

1 messages · Page 1 of 1 (latest)

empty crater
#

Is it possible to include live content collections with a sitemap generated from the <@&1055234544183287879>/sitemap integration? The sitemap would need to be generated on the fly every time a user requests the sitemap, rather than at build time.

subtle copperBOT
#

Hi @empty crater. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the provided knowledge sources, the @astrojs/sitemap integration is designed to generate sitemaps at build time by crawling statically-generated routes in your Astro project. It does not support generating sitemaps dynamically at request time (i.e., on the fly) and cannot include entries for dynamic routes in SSR mode or for data that is only available at runtime, such as live content collections fetched via the experimental live content collections API Astro Sitemap integration.

Live content collections are specifically designed to fetch data at runtime, not at build time Experimental live content collections. The sitemap integration, however, only works with statically-known pages at build time and does not have a mechanism to fetch or include live content entries when generating the sitemap.

Therefore, it is not possible to include live content collections in a sitemap generated by @astrojs/sitemap, nor to have the sitemap generated on the fly for each request using this integration. If you require a sitemap that reflects live, runtime data, you would need to implement a custom endpoint that generates the sitemap XML dynamically, outside of the @astrojs/sitemap integration.

I'm sorry, but the knowledge sources do not describe any built-in support for dynamic, runtime sitemap generation with live content collections in @astrojs/sitemap.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: