mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-08 22:03:01 +02:00
fix(v2): less strict blog/docs uri frontmatter validation (#5032)
This commit is contained in:
parent
425eccc5df
commit
f20599bb54
7 changed files with 151 additions and 52 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
import {
|
||||
JoiFrontMatter as Joi, // Custom instance for frontmatter
|
||||
URISchema,
|
||||
validateFrontMatter,
|
||||
} from '@docusaurus/utils-validation';
|
||||
import {Tag} from './types';
|
||||
|
@ -59,19 +60,19 @@ const BlogFrontMatterSchema = Joi.object<BlogPostFrontMatter>({
|
|||
|
||||
author: Joi.string(),
|
||||
author_title: Joi.string(),
|
||||
author_url: Joi.string().uri(),
|
||||
author_image_url: Joi.string().uri(),
|
||||
author_url: URISchema,
|
||||
author_image_url: URISchema,
|
||||
slug: Joi.string(),
|
||||
image: Joi.string().uri({relativeOnly: true}),
|
||||
image: URISchema,
|
||||
keywords: Joi.array().items(Joi.string().required()),
|
||||
hide_table_of_contents: Joi.boolean(),
|
||||
|
||||
// TODO re-enable warnings later, our v1 blog posts use those older frontmatter fields
|
||||
authorURL: Joi.string().uri(),
|
||||
authorURL: URISchema,
|
||||
// .warning('deprecate.error', { alternative: '"author_url"'}),
|
||||
authorTitle: Joi.string(),
|
||||
// .warning('deprecate.error', { alternative: '"author_title"'}),
|
||||
authorImageURL: Joi.string().uri(),
|
||||
authorImageURL: URISchema,
|
||||
// .warning('deprecate.error', { alternative: '"author_image_url"'}),
|
||||
})
|
||||
.unknown()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue