integrations/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/integrations/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.
safeString()
Section titled “safeString()”function safeString(str: string): any;
Defined in: studiocms/packages/studiocms/src/integrations/dynamic-sitemap/index.ts:31^
Converts a given string to a safe string format by removing leading and trailing underscores, and replacing the prefix ‘studiocms_’ if present.
Parameters
Section titled “Parameters”string
The input string to be converted.
Returns
Section titled “Returns”any
The converted safe string.