lib/dynamic-sitemap
Esta página aún no está disponible en tu idioma.
Functions
Section titled “Functions”dynamicSitemap()
Section titled “dynamicSitemap()”function dynamicSitemap(options: DynamicSitemapOptions): AstroIntegration
Defined in: studiocms/packages/studiocms/src/lib/dynamic-sitemap/index.ts:56
Generates a dynamic sitemap integration for Astro.
Parameters
Section titled “Parameters”options
Section titled “options”DynamicSitemapOptions
Configuration options for the dynamic sitemap.
Returns
Section titled “Returns”AstroIntegration
The Astro integration object.
The integration adds virtual imports for sitemaps and injects routes for the sitemap index and individual sitemaps.
The options
parameter should include:
sitemaps
: An array of objects, each containing:pluginName
: The name of the plugin.sitemapXMLEndpointPath
: The entry point path for the sitemap XML.
The function performs the following steps:
- Creates a resolver using the current module URL.
- Adds virtual imports for the sitemaps.
- Injects a route for the sitemap index.
- Iterates over the provided sitemaps and injects routes for each sitemap.
If multiple sitemaps have the same pattern, a unique pattern is generated by appending an index.