Add support for partials inside of partials, and relative partials #2692
+992
−75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds greater flexibility to our existing partials / includes
Adds support for partials to include other partials in them
If you have a partial that should build upon another partial, just
<Include />
itFor example:
filename: ./docs/_partials/welcome.mdx
filename: ./docs/_partials/getting-started.mdx
filename: ./docs/index.mdx
Would output:
filename: ./dist/index.mdx
Adds support for a
_partials
folder to exist anywhere in the docsa
_partials
folder can now be put anywhere in the./docs
folder, wherever is most relevant to the guides that will be consuming the partial. The existing partials can still be included usingsrc="_partial/
while relative will need to besrc="./_partial/
orsrc="../_partial/
For example:
filename: ./docs/billing/_partials/setup.mdx
filename: ./docs/billing/getting-started.mdx
Would output:
filename: ./dist/billing/getting-started.mdx
Example pr
Checkout #2693 to see how the relative partials can be used. That pr builds on top of this pr.
Checklist