-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(5.0.0): nitpicking and suggestions regarding on-demand-rendering.mdx
#9673
fix(5.0.0): nitpicking and suggestions regarding on-demand-rendering.mdx
#9673
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -38,7 +38,7 @@ All other pages are statically-generated at build time! | |||
|
|||
The following example shows opting out of prerendering in order to display a random number each time the endpoint is hit: | |||
|
|||
```js title="src/pages/randomnumber.js" {1} | |||
```js title="src/pages/randomnumber.js" ins={1} |
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.
nit: The previous example use ins={2}
, shouldn't we use the same visual information here? (or the other way around... not covered by my suggestion)
|
||
Then, if needed, you can choose to prerender any individual pages that do not require a server to execute, such as a privacy policy or about page. | ||
|
||
```astro title="src/pages/about-my-app.astro" | ||
```astro title="src/pages/about-my-app.astro" {2} |
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.
Same concern here about the highlighting. The next example uses "highlighting" but we don't use it here. Maybe we should use ins
here and in the next example too? (I just updated from the next example)
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.
Sure, let's make them all ins
!
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
|
|
||
```astro title="src/pages/my-product.astro" {10,11} | ||
```astro title="src/pages/product/[id].astro" {10,11} |
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.
From my understanding, Astro.params
only works with path segments (e.g. [id]
). See Astro.params (besides on this page, I wonder if the example should not be above the sentence related to SSR...)
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.
Sorry, where would you place this example?
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.
To avoid any confusion I am talking about the example in the section Astro.params
.
Sorry, I didn't detail as it's not related to this PR, it's just by checking Astro.params
that I thought the location of the example seemed strange.
The example shows the use of getStaticPaths
which is usable with static builds while the sentence just above talks about SSR builds. So what would seem more logical to me would be between the two sentences (In static builds,...
> getStaticPaths
example > In SSR builds, ...
).
But thinking back, I guess that was to avoid isolating the "SSR builds" sentence.
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.
Ah, gotcha now, thanks! Yes, I see what you mean. I think it could be helpful on that page to also have an SSR example maybe? And then yes, the example there above the SSR sentence, which itself gets its own example?
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.
I almost forgot about this comment, sorry. Yes I think it would be useful to show both uses here. 💯 I'm going to prepare a PR.
@@ -211,7 +211,7 @@ You can also return a [Response](https://developer.mozilla.org/en-US/docs/Web/AP | |||
|
|||
The example below returns a 404 on a dynamic page after looking up an ID in the database: | |||
|
|||
```astro title="src/pages/[id].astro" {10-13} | |||
```astro title="src/pages/product/[id].astro" {10-13} |
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.
I only updated because that's the path I had used before... it wasn't really a problem, just a matter of consistency.
Co-authored-by: Matthew Justice <[email protected]>
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.
Thank you @ArmandPhilippot these changes look great to me! I made one ins
suggestion where I could, and pointed out the one where I couldn't. But happy with this!
I will say, for the changes to the "Features" sections, which is basically copied from the existing server-side-rendering
page in main
branch, you can feel free to PR them to that page directly too, and this will let the translators work on that updated content in advance of this branch merging eventually. That would make that merge more just "copy paste" of that entire Features section, which I really hadn't intended to change here!
Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: Sarah Rainsberger <[email protected]>
Thanks for your feedback @sarah11918! I'm going to make a PR to update the current doc! 🫡 |
!coauthor |
Description (required)
every
)ins
)Astro.params
seemed wrong otherwiseAstro.redirect
inResponse
subsectionRelated issues & labels (optional)