-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sitemap filter does not actually filter pages #7256
Comments
Confirm, I can reproduce the issue. One solution might be to use integrations: [mdx(), sitemap({
serialize(item) {
if (item.url.includes('/api/')) {
return undefined;
}
return item;
},
})], |
Probably the problem is in this line:
I will work on a solution. |
This still doesn't work for me regardless of the number of filter arguments provided (1..N). When I tested with the filter matching the complete site URL, it still generated a full list of pages. Astro Version: 4.14.4 Example: site: 'https://site.url', This will generate a full set of s for the site. |
Hi @xirkus The following works for me:
with |
Ok based on the astro docs I have made the following changes to
The idea is that when I commit a blog post I prefix filename with todays date in the format |
What version of
astro
are you using?2.5.6
Are you using an SSR adapter? If so, which one?
Cloudflare
What package manager are you using?
pnpm
What operating system are you using?
Mac
What browser are you using?
Firefox
Describe the Bug
Sitemap
filter
option does not actually filter based on the callback provided.The repro shared is simple astro blog example where filter option is applied for not including
/api/
routes however generated sitemap still has the routes/api/test
Link to Minimal Reproducible Example
https://stackblitz.com/edit/astro-sitemap-repro
Participation
The text was updated successfully, but these errors were encountered: