It would be nice to have access to params in sitemap.ts files #77698
JamesSingleton
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
You can also just use a route.ts handler file, like,
Idk why the sitemap doesn't get those parameters though, but the idea with |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goals
Non-Goals
Background
I have a college sports news website that we are expanding from covering a single sport to multiple sports. For example, I have
/college/[sport]/news/page.tsx
and would like to add/college/[sport]/news/sitemap.ts
. However, right now you do not have access to that[sport]
in order to dynamically fetch the correct articles for the particular sport. So if the route is/college/football/news/sitemap/0.xml
, I would like to then fetch articles related to college football.Proposal
Allow access to params in the sitemap file just like you do page files. This should also apply to the
generateSitemaps
function so that you could fetch the total number of articles and calculate the number of sitemaps.Beta Was this translation helpful? Give feedback.
All reactions