-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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(v2): generalize usage of _ prefix convention to exclude content files/folders #5173
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✔️ [V2] 🔨 Explore the source changes: f9222e2 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/60f0182a2578b7000883a9c2 😎 Browse the preview: https://deploy-preview-5173--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5173--docusaurus-2.netlify.app/ |
Size Change: 0 B Total Size: 850 kB ℹ️ View Unchanged
|
This was referenced Jul 15, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
Signed Facebook CLA
pr: breaking change
Existing sites may not build successfully in the new version. Description contains more details.
pr: bug fix
This PR fixes a bug in a past release.
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.
Breaking change
exclude
config (onall of blog/docs/pages) to remove that _ prefix conventionMotivation
Generalize the usage of a _ file/folder prefix to ignore the creation of routes/pages for a given file, in all 3 content plugins.
This is mostly useful to co-locate partials and reusable components near the page/doc using them.
The following files should not lead to any created route:
Pages:
src/pages/_partial.md
src/pages/_partials/partial.md
src/pages/_partials/subfolder/partial.md
src/pages/_Component.js
src/pages/_Components/Components.js
src/pages/_Components/subfolder/Component.js
Docs:
docs/_partial.md
docs/_partials/partial.md
docs/_partials/subfolder/partial.md
Blog:
blog/_partial.md
blog/_partials/partial.md
blog/_partials/subfolder/partial.md
This feature was previously only partially supported in the page plugin (not supporting
_folder
). Now it's consistent everywhere.Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
tests
dogfood:
http://localhost:3000/docs/_partials/swizzleWarning
http://localhost:3000/docs/cli#docusaurus-swizzle-sitedir
http://localhost:3000/docs/using-themes#swizzling-theme-components