nextjs-sitemap-generator
nextjs-sitemap-generator copied to clipboard
Support to excluding dynamic routes
First, thanks for maintaining this project! Super useful.
I have the following project structure:
src
├── pages
│ ├── [lang]
│ │ └── content
│ │ ├── [title]
│ │ └── podcast
│ │ ├── [slug]
│ │ ├── author
│ │ │ └── [uid]
│ │ │ └── [pageNumber]
│ │ ├── page
│ │ │ └── [pageNumber]
│ │ └── tag
│ │ └── [tag]
│ │ └── [pageNumber]
I wish to dynamically exclude routes, like shown below:
ignoredPaths: [
'en/content/podcast/page/' // Works, but not ideal
'[lang]/content/podcast/page/', // Doesn't work :(
]
Another feature suggestion that could mitigate this use case is allowing the usage of regexes.
hey @yanmendes is it correct that you want to exclude all dynamic routes or only the placeholder (e.g., [pageNumber]
)? Because if you just want to exclude the placeholder you can try this:
ignoredPaths: ['[pageNumber]'],
But if you want to exclude all dynamic routes, I'm not sure. You'd have to try if something like this works:
ignoredPaths: ['page/[pageNumber]'],