mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
fix(v2): reject routeBasePath: '' (#3377)
* routeBasePath: '' should be forbidden * routeBasePath: '' should be forbidden * commit * try to trigger cla bot
This commit is contained in:
parent
d8cfabb66a
commit
1eb6e13fb7
9 changed files with 33 additions and 24 deletions
|
@ -22,7 +22,7 @@ test('should accept correctly defined user options', () => {
|
|||
...DEFAULT_OPTIONS,
|
||||
feedOptions: {type: 'rss', title: 'myTitle'},
|
||||
path: 'not_blog',
|
||||
routeBasePath: '',
|
||||
routeBasePath: 'myBlog',
|
||||
postsPerPage: 5,
|
||||
include: ['api/*', 'docs/*'],
|
||||
};
|
||||
|
@ -37,7 +37,7 @@ test('should accept correctly defined user options', () => {
|
|||
test('should accept valid user options', async () => {
|
||||
const userOptions = {
|
||||
...DEFAULT_OPTIONS,
|
||||
routeBasePath: '',
|
||||
routeBasePath: 'myBlog',
|
||||
beforeDefaultRemarkPlugins: [],
|
||||
beforeDefaultRehypePlugins: [markdownPluginsFunctionStub],
|
||||
remarkPlugins: [[markdownPluginsFunctionStub, {option1: '42'}]],
|
||||
|
|
|
@ -35,7 +35,10 @@ export const DEFAULT_OPTIONS = {
|
|||
|
||||
export const PluginOptionSchema = Joi.object({
|
||||
path: Joi.string().default(DEFAULT_OPTIONS.path),
|
||||
routeBasePath: Joi.string().allow('').default(DEFAULT_OPTIONS.routeBasePath),
|
||||
routeBasePath: Joi.string()
|
||||
// '' not allowed, see https://github.com/facebook/docusaurus/issues/3374
|
||||
// .allow('')
|
||||
.default(DEFAULT_OPTIONS.routeBasePath),
|
||||
include: Joi.array().items(Joi.string()).default(DEFAULT_OPTIONS.include),
|
||||
postsPerPage: Joi.number()
|
||||
.integer()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue