Layouts page rewrite#9335
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify site 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
|
| </body> | ||
| </html> | ||
| ``` | ||
| <ReadMore>Learn more about Astro’s Markdown and MDX support in our [Markdown guide](/en/guides/markdown-content/).</ReadMore> |
There was a problem hiding this comment.
Just noting that it's an intentional choice to leave "and MDX" in here because this section only is about MDX. And, the Markdown guide is a good place to read about general Markdown (in MDX) stuff.
|
|
||
| <ReadMore>Learn more about [slots](/en/basics/astro-components/#slots).</ReadMore> | ||
|
|
||
| ## Using TypeScript with layouts |
There was a problem hiding this comment.
Just noting that I moved this up for prominence, and to push the Markdown layout content (more niche/specific use case) lower on the page.
| ### Importing Layouts Manually (MDX) | ||
|
|
||
| You may need to pass information to your MDX layout that does not (or cannot) exist in your frontmatter. In this case, you can instead import and use a [`<Layout />` component](/en/basics/layouts/) and pass it props like any other component: | ||
| You can also use the special Markdown layout property in the frontmatter of MDX files to pass `frontmatter` and `headings` props directly to a specified layout component in the same way. |
There was a problem hiding this comment.
Just noting that this is basically what you get when you use the layout property in MDX files, so rather than complicate the list above, I intentionally made the entire thing above about Markdown, in favour of a streamlined sentence here.
at-the-vr
left a comment
There was a problem hiding this comment.
Sending in couple of title suggestions 😄
ArmandPhilippot
left a comment
There was a problem hiding this comment.
I have nothing to say with your changes (except a typo in a code block). Looks good to me!
Some additional feedback about the page structure:
- Moving the Typescript section outside of the Markdown layouts seems more consistent to me (this has nothing to do with Markdown). So I approve!
- I wonder if "Nesting Layouts" should not be between "Using TypeScript with layouts" and "Markdown Layout". Like you said, Markdown Layout are "more niche/specific use case" so I think this section should be the last... Especially if we want to encourage people to use content collections when possible... That said, my opinion may be biased. 😅
I also added other suggestions on portions you did not modify. This is mostly nitpicking!
Co-authored-by: Armand Philippot <git@armand.philippot.eu> Co-authored-by: Atharva <atharvapise19@gmail.com>
I did think about this, and debate it. BUT, I ended up thinking that it was more useful after showing Markdown layouts, because that's actually the exact pattern we were intending to show: having a Markdown layout wrapped in your regular BaseLayout. So, I think the stronger argument is to show it after we've shown And, you should see the changes coming to the Markdown page... it's really going to be encouraging collections! 😄 |
|
Thank you both for your reviews @ArmandPhilippot and @at-the-vr ! I really appreciate getting feedback on a quiet Saturday so I can keep on trucking.... 🚚 |
sarah11918
left a comment
There was a problem hiding this comment.
Why did I make a review instead of comment? Have to finish this off.
Oh yes, I hadn't paid attention to the example in "Nesting Layouts"... the order is therefore consistent. |
Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>
* i18n(fr): Update `basics/layouts` from #9335 Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com> * i18n(fr): Update `basics/layouts` from #9344 Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com> * Update src/content/docs/fr/basics/layouts.mdx Co-authored-by: Armand Philippot <git@armand.philippot.eu> * Update src/content/docs/fr/basics/layouts.mdx Co-authored-by: Armand Philippot <git@armand.philippot.eu> * Nesting Layouts part Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com> * Update src/content/docs/fr/basics/layouts.mdx Co-authored-by: Armand Philippot <git@armand.philippot.eu> --------- Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com> Co-authored-by: Armand Philippot <git@armand.philippot.eu> Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
Description (required)
This lightly updates the
/basics/layouts.mdxguide page to:The only content temporarily lost in published docs as a result of this is the code example, but a version of that will exist in the new Markdown page, where it is more helpful and discoverable.