mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-14 00:32:47 +02:00
feat(blog): add LastUpdateAuthor & LastUpdateTime (#9912)
Co-authored-by: OzakIOne <OzakIOne@users.noreply.github.com> Co-authored-by: sebastien <lorber.sebastien@gmail.com>
This commit is contained in:
parent
7938803747
commit
c745021b01
40 changed files with 833 additions and 359 deletions
|
@ -167,3 +167,16 @@ export const ContentVisibilitySchema = JoiFrontMatter.object<ContentVisibility>(
|
|||
"Can't be draft and unlisted at the same time.",
|
||||
})
|
||||
.unknown();
|
||||
|
||||
export const FrontMatterLastUpdateErrorMessage =
|
||||
'{{#label}} does not look like a valid last update object. Please use an author key with a string or a date with a string or Date.';
|
||||
|
||||
export const FrontMatterLastUpdateSchema = Joi.object({
|
||||
author: Joi.string(),
|
||||
date: Joi.date().raw(),
|
||||
})
|
||||
.or('author', 'date')
|
||||
.messages({
|
||||
'object.missing': FrontMatterLastUpdateErrorMessage,
|
||||
'object.base': FrontMatterLastUpdateErrorMessage,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue