mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-03 04:07:32 +02:00
fix(content-docs): create assets for frontmatter images (#6720)
* create assets for docs front matter images aswell fixes: #6718 * retrigger fb cla-check
This commit is contained in:
parent
ea6ceaa371
commit
c0b3c9af65
1 changed files with 10 additions and 0 deletions
|
@ -38,6 +38,7 @@ import type {
|
|||
DocFile,
|
||||
DocsMarkdownOption,
|
||||
VersionTag,
|
||||
DocFrontMatter,
|
||||
} from './types';
|
||||
import type {RuleSetRule} from 'webpack';
|
||||
import {cliDocsVersionCommand} from './cli';
|
||||
|
@ -360,6 +361,15 @@ export default async function pluginContentDocs(
|
|||
const aliasedPath = aliasedSitePath(mdxPath, siteDir);
|
||||
return path.join(dataDir, `${docuHash(aliasedPath)}.json`);
|
||||
},
|
||||
// Assets allow to convert some relative images paths to
|
||||
// require(...) calls
|
||||
createAssets: ({
|
||||
frontMatter,
|
||||
}: {
|
||||
frontMatter: DocFrontMatter;
|
||||
}) => ({
|
||||
image: frontMatter.image,
|
||||
}),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue