mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-27 21:48:41 +02:00
feat(blog-plugin): limit option for blog feedOptions (#9189)
This commit is contained in:
parent
e0bb39a40a
commit
4ecc86f89f
8 changed files with 164 additions and 8 deletions
|
@ -22,7 +22,7 @@ import type {
|
|||
import type {OptionValidationContext} from '@docusaurus/types';
|
||||
|
||||
export const DEFAULT_OPTIONS: PluginOptions = {
|
||||
feedOptions: {type: ['rss', 'atom'], copyright: ''},
|
||||
feedOptions: {type: ['rss', 'atom'], copyright: '', limit: 20},
|
||||
beforeDefaultRehypePlugins: [],
|
||||
beforeDefaultRemarkPlugins: [],
|
||||
admonitions: true,
|
||||
|
@ -123,6 +123,9 @@ const PluginOptionSchema = Joi.object<PluginOptions>({
|
|||
}),
|
||||
language: Joi.string(),
|
||||
createFeedItems: Joi.function(),
|
||||
limit: Joi.alternatives()
|
||||
.try(Joi.number(), Joi.valid(null), Joi.valid(false))
|
||||
.default(DEFAULT_OPTIONS.feedOptions.limit),
|
||||
}).default(DEFAULT_OPTIONS.feedOptions),
|
||||
authorsMapPath: Joi.string().default(DEFAULT_OPTIONS.authorsMapPath),
|
||||
readingTime: Joi.function().default(() => DEFAULT_OPTIONS.readingTime),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue