mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-27 13:38:33 +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
|
@ -51,6 +51,7 @@ export const DEFAULT_OPTIONS: PluginOptions = {
|
|||
authorsMapPath: 'authors.yml',
|
||||
readingTime: ({content, defaultReadingTime}) => defaultReadingTime({content}),
|
||||
sortPosts: 'descending',
|
||||
processBlogPosts: async () => undefined,
|
||||
};
|
||||
|
||||
const PluginOptionSchema = Joi.object<PluginOptions>({
|
||||
|
@ -134,6 +135,9 @@ const PluginOptionSchema = Joi.object<PluginOptions>({
|
|||
sortPosts: Joi.string()
|
||||
.valid('descending', 'ascending')
|
||||
.default(DEFAULT_OPTIONS.sortPosts),
|
||||
processBlogPosts: Joi.function()
|
||||
.optional()
|
||||
.default(() => DEFAULT_OPTIONS.processBlogPosts),
|
||||
}).default(DEFAULT_OPTIONS);
|
||||
|
||||
export function validateOptions({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue