update ChangeFreq
to support typescript configurations with string literal (#6262)
* update `ChangeFreq`
* `pnpm exec changeset`
* use @Princesseuh suggested change
* Revert "use @Princesseuh suggested change"
This reverts commit a1e5660c25
.
* use @Princesseuh suggested change and an `as`
This commit is contained in:
parent
2e4ca0370a
commit
4fcefa34f9
3 changed files with 8 additions and 2 deletions
5
.changeset/shiny-years-beg.md
Normal file
5
.changeset/shiny-years-beg.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/sitemap': minor
|
||||
---
|
||||
|
||||
update `ChangeFreq` to support typescript configurations with string literal or predefined value.
|
|
@ -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,
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue