mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-03 12:17:20 +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,
|
DocFile,
|
||||||
DocsMarkdownOption,
|
DocsMarkdownOption,
|
||||||
VersionTag,
|
VersionTag,
|
||||||
|
DocFrontMatter,
|
||||||
} from './types';
|
} from './types';
|
||||||
import type {RuleSetRule} from 'webpack';
|
import type {RuleSetRule} from 'webpack';
|
||||||
import {cliDocsVersionCommand} from './cli';
|
import {cliDocsVersionCommand} from './cli';
|
||||||
|
@ -360,6 +361,15 @@ export default async function pluginContentDocs(
|
||||||
const aliasedPath = aliasedSitePath(mdxPath, siteDir);
|
const aliasedPath = aliasedSitePath(mdxPath, siteDir);
|
||||||
return path.join(dataDir, `${docuHash(aliasedPath)}.json`);
|
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