mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-17 10:12:25 +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
|
@ -330,6 +330,11 @@ yarn workspace v1.22.19image` is a collocated image path, this entry will be the
|
|||
defaultReadingTime: ReadingTimeFunction;
|
||||
},
|
||||
) => number | undefined;
|
||||
|
||||
export type ProcessBlogPostsFn = (params: {
|
||||
blogPosts: BlogPost[];
|
||||
}) => Promise<void | BlogPost[]>;
|
||||
|
||||
/**
|
||||
* Plugin options after normalization.
|
||||
*/
|
||||
|
@ -421,6 +426,10 @@ yarn workspace v1.22.19image` is a collocated image path, this entry will be the
|
|||
readingTime: ReadingTimeFunctionOption;
|
||||
/** Governs the direction of blog post sorting. */
|
||||
sortPosts: 'ascending' | 'descending';
|
||||
/** An optional function which can be used to transform blog posts
|
||||
* (filter, modify, delete, etc...).
|
||||
*/
|
||||
processBlogPosts: ProcessBlogPostsFn;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue