From 6c4ae6c319147162c697d41b3ce28862462d76a1 Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Wed, 24 Apr 2024 11:12:57 -0700 Subject: [PATCH] Accept date in badges. Fix errors in build. Our guidelines suggest adding a date when using the badge markdoc component, but until now the component's schema didn't have a defintion for the date parameter, so it was reporting errors. The date doesn't affect how the badge is displayed on the site, but we can use it to see when a 'New in' badge is old enough to no longer be relevant (typically >2yrs) so we can remove it. --- @theme/markdoc/schema.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/@theme/markdoc/schema.ts b/@theme/markdoc/schema.ts index 1dc2774eff..4531c5fcc6 100644 --- a/@theme/markdoc/schema.ts +++ b/@theme/markdoc/schema.ts @@ -122,6 +122,10 @@ export const badge: Schema & { tagName: string } = { href: { type: 'String', required: false + }, + date: { // Not displayed, but useful for knowing how old an 'updated' badge is + type: 'String', + required: false } }, render: 'Badge'