diff --git a/.changeset/shiny-years-beg.md b/.changeset/shiny-years-beg.md new file mode 100644 index 000000000000..a7c834e6962d --- /dev/null +++ b/.changeset/shiny-years-beg.md @@ -0,0 +1,5 @@ +--- +'@astrojs/sitemap': minor +--- + +update `ChangeFreq` to support typescript configurations with string literal or predefined value. diff --git a/packages/integrations/sitemap/src/generate-sitemap.ts b/packages/integrations/sitemap/src/generate-sitemap.ts index c11504822497..cb10bf2f6a18 100644 --- a/packages/integrations/sitemap/src/generate-sitemap.ts +++ b/packages/integrations/sitemap/src/generate-sitemap.ts @@ -1,3 +1,4 @@ +import { EnumChangefreq } from 'sitemap'; import type { SitemapItem, SitemapOptions } from './index.js'; import { parseUrl } from './utils/parse-url.js'; @@ -44,7 +45,7 @@ export function generateSitemap(pages: string[], finalSiteUrl: string, opts: Sit links, lastmod, priority, - changefreq, + changefreq: changefreq as EnumChangefreq, }; }); diff --git a/packages/integrations/sitemap/src/index.ts b/packages/integrations/sitemap/src/index.ts index bab3d5af6fb3..4feee29587a4 100644 --- a/packages/integrations/sitemap/src/index.ts +++ b/packages/integrations/sitemap/src/index.ts @@ -12,7 +12,7 @@ import { generateSitemap } from './generate-sitemap.js'; import { Logger } from './utils/logger.js'; import { validateOptions } from './validate-options.js'; -export type ChangeFreq = EnumChangefreq; +export type ChangeFreq = `${EnumChangefreq}`; export type SitemapItem = Pick< SitemapItemLoose, 'url' | 'lastmod' | 'changefreq' | 'priority' | 'links'