Add "Accessing route data" section in getStaticPaths with routePattern#12316
Conversation
Add section on accessing route data and example code for getStaticPaths.
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
sarah11918
left a comment
There was a problem hiding this comment.
This looks great @openscript ! Thank you for providing such a clear starting point for these docs! 💪
I had some thoughts below for your consideration, and some questions. You are the subject matter expert here, and I'm just suggesting some words that would make this "sound like" Astro Docs, but I'll need to rely on you to confirm some things and make this accurate! 🙌
Then, when we're happy here, we'll tackle the changeset in the Astro PR where we really get to hype how cool this is, introduce it to the world, and encourage people to use it! 🚀
Add section on accessing route data and example code for getStaticPaths.
Description (required)
This documents the proposal to make
routePatternavailable ingetStaticPaths. WithroutePatternit's possible to dynamically calculate theparamsthatgetStaticPathsreturns. Before it was not possible to access theroutePatternbecausegetStaticPathsis executed at a time whenAstro.routePatternis not available.Related issues & labels (optional)
For Astro version:
5.14. See astro PR #13520.Known as openscript in Discord.