From 6ce97b1ebe9a1b82a87f1e205213230d3bf81e4e Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Fri, 11 Mar 2022 08:56:54 -0800 Subject: [PATCH] fix sitemapFilter docs (#2762) --- packages/astro/src/@types/astro.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index a49dd495b..0f08a4ee7 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -229,16 +229,20 @@ export interface AstroUserConfig { /** * @docs * @name buildOptions.sitemapFilter - * @type {undefined|((page: string) => boolean)} - * @default `undefined` + * @typeraw {(page: string) => boolean} + * @see buildOptions.sitemap * @description - * Customize sitemap generation for your build by excluding certain pages. + * By default, all pages are included in your generated sitemap. + * You can filter included pages by URL using `buildOptions.sitemapFilter`. + * + * The `page` function parameter is the full URL of your rendered page, including your `buildOptions.site` domain. + * Return `true` to include a page in your sitemap, and `false` to remove it. * * ```js * { * buildOptions: { * sitemap: true - * sitemapFilter: (page) => !page.includes('secret-page') + * sitemapFilter: (page) => page !== 'http://example.com/secret-page') * } * } * ```