-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: automatic Markdoc partial resolution #10649
Conversation
🦋 Changeset detectedLatest commit: 39994e6 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Seems the test file contains too many prod build calls and times out. Will try to reuse fixtures and split the |
@bholmesdev Just wanted to check on the naming convention here Ben, because we are currently referring to "page partials" as just plain old "partials" (I guess, the only kind we had so it didn't much matter): https://docs.astro.build/en/basics/astro-pages/#page-partials So, I'm wondering whether in conjunction with your PR documenting Markdoc partials we should update wording on the Pages page to always say "page partial" and whether we should be clear to always say "Markdoc partial" when referring to these files. The joys of adding the second thing that use the same word. 😄 |
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.
Can we have at least one test that raises an error in case we attempt to render a partial that doesn't exist or it's an incorrect folder? This would help to set down expectations.
Use native astro markdoc support for `partial` instead. See withastro/astro#10418 and withastro/astro#10649
Use native astro markdoc support for `partial` instead. See withastro/astro#10418 and withastro/astro#10649
Resolves #10418
Changes
This adds automatic resolution for Markdoc partials by relative file path.
partial
tags. When one is found, render the partial in-place and assign the node. Flattening lets us catch validation errors at buildtime and discover nested component tags for hoisted scripts.partials
are still respected to make this a non-breaking featureaddWatchFile()
Testing
Add tests to render components and HTML within a partial.
Docs
withastro/docs#7743