Skip to content
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: The RE used to filter status codes during sitemap generation blocks some of the business logic #7472

Closed
1 task
bingS-code opened this issue Jun 25, 2023 · 1 comment · Fixed by #7655
Labels
- P2: nice to have Not breaking anything but nice to have (priority)

Comments

@bingS-code
Copy link

What version of astro are you using?

2.3.0

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Windows

What browser are you using?

Chrome

Describe the Bug

The STATUS_CODE_PAGE_REGEXP regular in generate-sitemap.js filters out three-number dynamic routes

What's the expected result?

The regular expression used to filter status codes during sitemap generation also filters out dynamic routes consisting of three digits. Can we optimize and adapt this filtering section to the site business logic of three-digit dynamic routing?

Link to Minimal Reproducible Example

null

Participation

  • I am willing to submit a pull request for this issue.
@bluwy
Copy link
Member

bluwy commented Jun 26, 2023

Perhaps we can restrict that to only 404 and 500 like

const STATUS_CODE_PAGES = new Set(['/404', '/500']);

Shouldn't be a breaking change 🤔

@bluwy bluwy added the - P2: nice to have Not breaking anything but nice to have (priority) label Jun 26, 2023
natemoo-re added a commit that referenced this issue Jul 14, 2023
* fix(#7472): sitemap should only exclude 404 and 500 pages

* chore: refactor logic, add test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants