mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-22 11:07:51 +02:00
feat(core): Add siteConfig.markdown.hooks
, deprecate siteConfig.onBrokenMarkdownLinks
(#11283)
This commit is contained in:
parent
ef71ddf937
commit
96c38d5fdd
35 changed files with 1580 additions and 381 deletions
|
@ -71,7 +71,7 @@ export default async function pluginContentBlog(
|
|||
);
|
||||
}
|
||||
|
||||
const {onBrokenMarkdownLinks, baseUrl} = siteConfig;
|
||||
const {baseUrl} = siteConfig;
|
||||
|
||||
const contentPaths: BlogContentPaths = {
|
||||
contentPath: path.resolve(siteDir, options.path),
|
||||
|
@ -154,18 +154,12 @@ export default async function pluginContentBlog(
|
|||
},
|
||||
markdownConfig: siteConfig.markdown,
|
||||
resolveMarkdownLink: ({linkPathname, sourceFilePath}) => {
|
||||
const permalink = resolveMarkdownLinkPathname(linkPathname, {
|
||||
return resolveMarkdownLinkPathname(linkPathname, {
|
||||
sourceFilePath,
|
||||
sourceToPermalink: contentHelpers.sourceToPermalink,
|
||||
siteDir,
|
||||
contentPaths,
|
||||
});
|
||||
if (permalink === null) {
|
||||
logger.report(
|
||||
onBrokenMarkdownLinks,
|
||||
)`Blog markdown link couldn't be resolved: (url=${linkPathname}) in source file path=${sourceFilePath}`;
|
||||
}
|
||||
return permalink;
|
||||
},
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue