feat(pages): add support for missing SEO front matter + improve SEO docs (#9071)

Co-authored-by: Thad Guidry <thadguidry@gmail.com>
This commit is contained in:
Sébastien Lorber 2023-06-15 16:07:00 +02:00 committed by GitHub
parent 117cbac702
commit 9866af7f44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 146 additions and 22 deletions

View file

@ -31,6 +31,7 @@ import type {
PluginOptions,
Metadata,
LoadedContent,
PageFrontMatter,
} from '@docusaurus/plugin-content-pages';
export function getContentPathList(contentPaths: PagesContentPaths): string[] {
@ -234,6 +235,15 @@ export default function pluginContentPages(
`${docuHash(aliasedSource)}.json`,
);
},
// Assets allow to convert some relative images paths to
// require(...) calls
createAssets: ({
frontMatter,
}: {
frontMatter: PageFrontMatter;
}) => ({
image: frontMatter.image,
}),
markdownConfig: siteConfig.markdown,
},
},