-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add "Accessing route data" section in getStaticPaths
with routePattern
#12316
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
base: main
Are you sure you want to change the base?
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As Sarah said, this looks great. I mostly answered Sarah's suggestion and also give some ideas to improve the code snippet used as example.
Add section on accessing route data and example code for getStaticPaths.
Description (required)
This documents the proposal to make
routePattern
available ingetStaticPaths
. WithroutePattern
it's possible to dynamically calculate theparams
thatgetStaticPaths
returns. Before it was not possible to access theroutePattern
becausegetStaticPaths
is executed at a time whenAstro.routePattern
is not available.Related issues & labels (optional)
For Astro version:
5.15
. See astro PR #13520.Known as openscript in Discord.