Skip to content
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
merged 5 commits into from
Jul 15, 2021

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Jul 15, 2021

Breaking change

        exclude: [
-         '**/_*.{js,jsx,ts,tsx,md,mdx}',
-         '**/_*/**',
          '**/*.test.{js,jsx,ts,tsx}',
          '**/__tests__/**',
        ],

Motivation

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

@netlify
Copy link

netlify bot commented Jul 15, 2021

✔️ [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

@github-actions
Copy link

github-actions bot commented Jul 15, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 98
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5173--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Jul 15, 2021

Size Change: 0 B

Total Size: 850 kB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 58.8 kB
website/build/assets/css/styles.********.css 89 kB
website/build/assets/js/main.********.js 459 kB
website/build/blog/2017/12/14/introducing-docusaurus/index.html 62.4 kB
website/build/blog/index.html 26.3 kB
website/build/docs-tests/index.html 20.3 kB
website/build/docs-tests/standalone/index.html 18.8 kB
website/build/docs/index.html 40.2 kB
website/build/docs/installation/index.html 47.9 kB
website/build/index.html 27.3 kB

compressed-size-action

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants