Zum Inhalt springen

integrations/dynamic-sitemap

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

function dynamicSitemap(options: DynamicSitemapOptions): AstroIntegration;

Defined in: studiocms/packages/studiocms/src/integrations/dynamic-sitemap/index.ts:56^

Generates a dynamic sitemap integration for Astro.

DynamicSitemapOptions

Configuration options for the dynamic sitemap.

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:

  1. Creates a resolver using the current module URL.
  2. Adds virtual imports for the sitemaps.
  3. Injects a route for the sitemap index.
  4. 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.


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.

string

The input string to be converted.

any

The converted safe string.