mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-19 09:37:43 +02:00
feat: upgrade to MDX v2 (#8288)
Co-authored-by: Armano <armano2@users.noreply.github.com>
This commit is contained in:
parent
10f161d578
commit
bf913aea2a
161 changed files with 4028 additions and 2821 deletions
|
@ -8,6 +8,7 @@
|
|||
import logger from '@docusaurus/logger';
|
||||
import Yaml from 'js-yaml';
|
||||
import {PluginIdSchema} from './validationSchemas';
|
||||
import type {ValidationOptions} from 'joi';
|
||||
import type Joi from './Joi';
|
||||
|
||||
/** Print warnings returned from Joi validation. */
|
||||
|
@ -77,13 +78,15 @@ export function normalizeThemeConfig<T>(
|
|||
* Validate front matter with better error message
|
||||
*/
|
||||
export function validateFrontMatter<T>(
|
||||
frontMatter: {[key: string]: unknown},
|
||||
frontMatter: unknown,
|
||||
schema: Joi.ObjectSchema<T>,
|
||||
options?: ValidationOptions,
|
||||
): T {
|
||||
const {value, error, warning} = schema.validate(frontMatter, {
|
||||
convert: true,
|
||||
allowUnknown: true,
|
||||
abortEarly: false,
|
||||
...options,
|
||||
});
|
||||
|
||||
printWarning(warning);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue