mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-22 05:27:00 +02:00
feat(v2): blog + docs multi-instance plugins (#3204)
* stable createData namespacing + second-blog dogfooding * Docs: support multi-instance + make community docs a separate instance * tests: add 2nd docs instance to versioned site * fix docs version cli tests * fix docs versioning cli * typo * team: add link to my site * better extendCli integration * fix metadata tests * tests for versioned site with second docs instance * move some validation code to utils-validation * fix missing dependency * fix bad compiled output due to importing constants in ./client folder * make docs tests easier to maintain * refactors * prevent lodash imports in client bundle * redirect old community docs to new urls
This commit is contained in:
parent
e944f35640
commit
59f705ee66
67 changed files with 2025 additions and 2059 deletions
packages/docusaurus-utils-validation/src
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import * as Joi from '@hapi/joi';
|
||||
|
||||
export const PluginIdSchema = Joi.string()
|
||||
.regex(/^[a-zA-Z_\-]+$/)
|
||||
// duplicate core constant, otherwise cyclic dependency is created :(
|
||||
.default('default');
|
||||
|
||||
const MarkdownPluginsSchema = Joi.array()
|
||||
.items(
|
||||
Joi.array()
|
||||
// TODO, this allows [config,fn] too?
|
||||
.items(Joi.function().required(), Joi.object().required())
|
||||
.length(2),
|
||||
Joi.function(),
|
||||
)
|
||||
.default([]);
|
||||
|
||||
export const RemarkPluginsSchema = MarkdownPluginsSchema;
|
||||
export const RehypePluginsSchema = MarkdownPluginsSchema;
|
||||
|
||||
export const AdmonitionsSchema = Joi.object().default({});
|
Loading…
Add table
Add a link
Reference in a new issue