0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-27 22:19:04 -05:00

Added slashes at the end of the filter option in the sitemap docs (#7915)

I trend to implement the sitemap and I found out that filter option works only when the URL has slashes at the end. I changed the examples.

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
Marek Brzezinski 2023-08-07 19:52:13 +02:00 committed by GitHub
parent 9d0070095e
commit 6a27e932d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,7 +148,7 @@ All pages are included in your sitemap by default. By adding a custom `filter` f
// astro.config.mjs // astro.config.mjs
// ... // ...
sitemap({ sitemap({
filter: (page) => page !== 'https://stargazers.club/secret-vip-lounge', filter: (page) => page !== 'https://stargazers.club/secret-vip-lounge/',
}); });
``` ```
@ -161,10 +161,10 @@ To filter multiple pages, add arguments with target URLs.
// ... // ...
sitemap({ sitemap({
filter: (page) => filter: (page) =>
page !== 'https://stargazers.club/secret-vip-lounge-1' && page !== 'https://stargazers.club/secret-vip-lounge-1/' &&
page !== 'https://stargazers.club/secret-vip-lounge-2' && page !== 'https://stargazers.club/secret-vip-lounge-2/' &&
page !== 'https://stargazers.club/secret-vip-lounge-3' && page !== 'https://stargazers.club/secret-vip-lounge-3/' &&
page !== 'https://stargazers.club/secret-vip-lounge-4', page !== 'https://stargazers.club/secret-vip-lounge-4/',
}); });
``` ```