fix: add admonitions support to mdx partials loaded through the fallback mdx loader (#5339)

This commit is contained in:
Sébastien Lorber 2021-08-11 16:33:25 +02:00 committed by GitHub
parent ee6ebc4877
commit 1f8fa5e859
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -98,6 +98,7 @@
"react-router": "^5.2.0",
"react-router-config": "^5.1.1",
"react-router-dom": "^5.2.0",
"remark-admonitions": "^1.2.1",
"resolve-pathname": "^3.0.0",
"rtl-detect": "^1.0.3",
"semver": "^7.3.4",

View file

@ -39,6 +39,7 @@ import {
} from './translations/translations';
import {mapValues} from 'lodash';
import {RuleSetRule} from 'webpack';
import admonitions from 'remark-admonitions';
export type LoadContextOptions = {
customOutDir?: string;
@ -225,6 +226,7 @@ function createMDXFallbackPlugin({siteDir}: {siteDir: string}): LoadedPlugin {
staticDir: path.join(siteDir, STATIC_DIR_NAME),
isMDXPartial: (_filename) => true, // External mdx files are always meant to be imported as partials
isMDXPartialFrontMatterWarningDisabled: true, // External mdx files might have frontmatter, let's just disable the warning
remarkPlugins: [admonitions],
},
},
],