feat(v2): add beforeDefaultRemarkPlugins/beforeDefaultRehypePlugins options to all md content plugins (#3467)

* fix(plugin-content-docs): add beforeDefaultRemarkPlugins + beforeDefaultRehypePlugins options

* fix(plugin-content-blog): add beforeDefaultRemarkPlugins + beforeDefaultRehypePlugins options

* fix(plugin-content-pages): add beforeDefaultRemarkPlugins + beforeDefaultRehypePlugins options

* feat(website-docs): overriding remark-rehype plugins

* fix(plugin-content): update beforeDefaultRehypePlugins/beforeDefaultRemarkPlugins types

* fix(plugin-content-docs): fix tests
This commit is contained in:
Rémi Doreau 2020-09-29 14:48:34 +02:00 committed by GitHub
parent f343450e85
commit d3a01458a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 57 additions and 3 deletions

View file

@ -343,7 +343,13 @@ export default function pluginContentBlog(
isServer: boolean,
{getBabelLoader, getCacheLoader}: ConfigureWebpackUtils,
) {
const {rehypePlugins, remarkPlugins, truncateMarker} = options;
const {
rehypePlugins,
remarkPlugins,
truncateMarker,
beforeDefaultRemarkPlugins,
beforeDefaultRehypePlugins,
} = options;
return {
resolve: {
alias: {
@ -363,6 +369,8 @@ export default function pluginContentBlog(
options: {
remarkPlugins,
rehypePlugins,
beforeDefaultRemarkPlugins,
beforeDefaultRehypePlugins,
staticDir: path.join(siteDir, STATIC_DIR_NAME),
// Note that metadataPath must be the same/in-sync as
// the path from createData for each MDX.