mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-22 13:37:05 +02:00
refactor(mdx-loader): re-export metadata module instead of serializing it (#10470)
This commit is contained in:
parent
3d69ff3d47
commit
a47e8dda2d
6 changed files with 33 additions and 145 deletions
|
@ -123,18 +123,9 @@ export default async function pluginContentDocs(
|
|||
// Note that metadataPath must be the same/in-sync as
|
||||
// the path from createData for each MDX.
|
||||
const aliasedPath = aliasedSitePath(mdxPath, siteDir);
|
||||
const metadataPath = path.join(
|
||||
dataDir,
|
||||
`${docuHash(aliasedPath)}.json`,
|
||||
);
|
||||
const metadataContent = contentHelpers.sourceToDoc.get(aliasedPath);
|
||||
return {
|
||||
metadataPath,
|
||||
metadataContent,
|
||||
};
|
||||
return path.join(dataDir, `${docuHash(aliasedPath)}.json`);
|
||||
},
|
||||
// Assets allow to convert some relative images paths to
|
||||
// require(...) calls
|
||||
// createAssets converts relative paths to require() calls
|
||||
createAssets: ({frontMatter}: {frontMatter: DocFrontMatter}) => ({
|
||||
image: frontMatter.image,
|
||||
}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue