mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
fix(v2): make config validation less strict (#3120)
* fix(v2): make navbar title validation less strict * fix(v2): fix validation for rehype plugin * fix(v2): allow empty string for routeBasePath * fix(v2): fix validation for stylesheets and scripts field * fix(v2): rerun CI * fix(v2): relax check for stylesheet href
This commit is contained in:
parent
41d5ac63fd
commit
2159c4fcfb
4 changed files with 26 additions and 16 deletions
|
@ -28,7 +28,7 @@ export const DEFAULT_OPTIONS = {
|
|||
|
||||
export const PluginOptionSchema = Joi.object({
|
||||
path: Joi.string().default(DEFAULT_OPTIONS.path),
|
||||
routeBasePath: Joi.string().default(DEFAULT_OPTIONS.routeBasePath),
|
||||
routeBasePath: Joi.string().allow('').default(DEFAULT_OPTIONS.routeBasePath),
|
||||
include: Joi.array().items(Joi.string()).default(DEFAULT_OPTIONS.include),
|
||||
postsPerPage: Joi.number()
|
||||
.integer()
|
||||
|
@ -45,16 +45,19 @@ export const PluginOptionSchema = Joi.object({
|
|||
showReadingTime: Joi.bool().default(DEFAULT_OPTIONS.showReadingTime),
|
||||
remarkPlugins: Joi.array()
|
||||
.items(
|
||||
Joi.alternatives().try(
|
||||
Joi.function(),
|
||||
Joi.array()
|
||||
.items(Joi.function().required(), Joi.object().required())
|
||||
.length(2),
|
||||
),
|
||||
Joi.array()
|
||||
.items(Joi.function().required(), Joi.object().required())
|
||||
.length(2),
|
||||
Joi.function(),
|
||||
)
|
||||
.default(DEFAULT_OPTIONS.remarkPlugins),
|
||||
rehypePlugins: Joi.array()
|
||||
.items(Joi.string())
|
||||
.items(
|
||||
Joi.array()
|
||||
.items(Joi.function().required(), Joi.object().required())
|
||||
.length(2),
|
||||
Joi.function(),
|
||||
)
|
||||
.default(DEFAULT_OPTIONS.rehypePlugins),
|
||||
editUrl: Joi.string().uri(),
|
||||
truncateMarker: Joi.object().default(DEFAULT_OPTIONS.truncateMarker),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue