mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-25 15:07:17 +02:00
feat(blog): allow processing blog posts through a processBlogPosts function (#9886)
Co-authored-by: OzakIOne <OzakIOne@users.noreply.github.com> Co-authored-by: sebastien <lorber.sebastien@gmail.com> Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
This commit is contained in:
parent
05279dc3d8
commit
2851c93d0d
12 changed files with 400 additions and 6 deletions
|
@ -422,3 +422,19 @@ export function linkify({
|
|||
|
||||
return newContent;
|
||||
}
|
||||
|
||||
export async function applyProcessBlogPosts({
|
||||
blogPosts,
|
||||
processBlogPosts,
|
||||
}: {
|
||||
blogPosts: BlogPost[];
|
||||
processBlogPosts: PluginOptions['processBlogPosts'];
|
||||
}): Promise<BlogPost[]> {
|
||||
const processedBlogPosts = await processBlogPosts({blogPosts});
|
||||
|
||||
if (Array.isArray(processedBlogPosts)) {
|
||||
return processedBlogPosts;
|
||||
}
|
||||
|
||||
return blogPosts;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue