mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 07:37:19 +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
|
@ -29,7 +29,7 @@ export const DEFAULT_OPTIONS: PluginOptions = {
|
|||
export const PluginOptionSchema = Joi.object({
|
||||
path: Joi.string().default(DEFAULT_OPTIONS.path),
|
||||
editUrl: Joi.string().uri(),
|
||||
routeBasePath: Joi.string().default(DEFAULT_OPTIONS.routeBasePath),
|
||||
routeBasePath: Joi.string().allow('').default(DEFAULT_OPTIONS.routeBasePath),
|
||||
homePageId: Joi.string().default(DEFAULT_OPTIONS.homePageId),
|
||||
include: Joi.array().items(Joi.string()).default(DEFAULT_OPTIONS.include),
|
||||
sidebarPath: Joi.string().default(DEFAULT_OPTIONS.sidebarPath),
|
||||
|
@ -37,12 +37,19 @@ export const PluginOptionSchema = Joi.object({
|
|||
docItemComponent: Joi.string().default(DEFAULT_OPTIONS.docItemComponent),
|
||||
remarkPlugins: Joi.array()
|
||||
.items(
|
||||
Joi.array().items(Joi.function(), Joi.object()).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),
|
||||
showLastUpdateTime: Joi.bool().default(DEFAULT_OPTIONS.showLastUpdateTime),
|
||||
showLastUpdateAuthor: Joi.bool().default(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue