Skip to content

feat: mdx loader fallback, allow importing mdx docs from anywhere - #5299

Merged
slorber merged 8 commits into
masterfrom
slorber/fallback-mdx-loader
Aug 6, 2021
Merged

slorber merged 8 commits into
masterfrom
slorber/fallback-mdx-loader

Conversation

@slorber

@slorber slorber commented Aug 5, 2021 •

Copy link
Copy Markdown
Collaborator

Motivation

We should allow importing MDX files that are outside the content plugin folders.

This is particularly helpful if some user wants to display the repo/README.md in his site: he can just import the file from an existing doc as a partial.

Of course we still have the annoying TOC headings issue so this use-case is not 100% solved (#3915)

This still solves a few issues users already reported, such as this one where the user tries to import an MDX file from src/components/_markdownPartial.mdx, for which no mdx-loader was configured (#5286)

Users expect to be able to import an MDX file, no matter where it's located.

There are shortcomings to the current system though, as the remark/rehype plugins and the additional linkify logic of the issues won't be applied to this out-of-content-plugin mdx file. For this to work we probably need better markdown infrastructure. The current solution is a good enough one, but may not work in all use-cases. Let's wait for someone to complain and see if it's worth improving it.

Also move some dogfooding stuff to the _dogfooding folder

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

Dogfooding in the test instances

Also displaying the changelog on our own website: https://deploy-preview-5299--docusaurus-2.netlify.app/community/changelog/

@slorber
slorber requested a review from lex111 as a code owner August 5, 2021 14:47
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 5, 2021
@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Aug 5, 2021
@netlify

netlify Bot commented Aug 5, 2021 •

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Aug 5, 2021 •

Copy link
Copy Markdown

⚡️ Lighthouse report for the changes in this PR:

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

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

@github-actions

github-actions Bot commented Aug 5, 2021 •

Copy link
Copy Markdown

Size Change: +875 B (0%)

Total Size: 787 kB

Filename Size Change
website/.docusaurus/globalData.json 36.1 kB +145 B (0%)
website/build/assets/js/main.********.js 403 kB +732 B (0%)
ℹ️ View Unchanged
Filename Size Change
website/build/assets/css/styles.********.css 93.4 kB 0 B
website/build/blog/2017/12/14/introducing-docusaurus/index.html 63.9 kB 0 B
website/build/blog/index.html 27.8 kB 0 B
website/build/docs/index.html 41.9 kB -1 B (0%)
website/build/docs/installation/index.html 49.6 kB -1 B (0%)
website/build/index.html 28.7 kB 0 B
website/build/tests/docs/index.html 22.6 kB 0 B
website/build/tests/docs/standalone/index.html 20.5 kB 0 B

compressed-size-action

@slorber slorber changed the title feat: mdx loader fallback feat: mdx loader fallback, allow importing mdx docs from anywhere Aug 6, 2021
@slorber
slorber merged commit 916b821 into master Aug 6, 2021
@slorber
slorber deleted the slorber/fallback-mdx-loader branch August 6, 2021 09:32
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
…ta#5299)

* move deep filepath test

* split markdownPageExample.md

* re-org dogfooding content

* Add mdx partials fallback synthetic plugin by default

* test commit

* hide changelog title as it's already included in the partial file

* trigger CI

* fix changelog sidebar label
sparanoid pushed a commit to sparanoid/docusaurus that referenced this pull request Oct 12, 2026
…ta#5299)

* move deep filepath test

* split markdownPageExample.md

* re-org dogfooding content

* Add mdx partials fallback synthetic plugin by default

* test commit

* hide changelog title as it's already included in the partial file

* trigger CI

* fix changelog sidebar label
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: new feature This PR adds a new API or behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants