From 0d59a6d2995b4119865271ed1908ede0bb96497c Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 9 May 2022 18:19:38 +0200 Subject: refactor: rewrite DescriptionList and Meta components The meta can have different layout. The previous implementation was not enough to easily change the layout. Also, I prefer to restrict the meta types and it prevents me to repeat myself for the labels. --- src/pages/contact.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pages/contact.tsx') diff --git a/src/pages/contact.tsx b/src/pages/contact.tsx index d88a8a1..fcfbe1d 100644 --- a/src/pages/contact.tsx +++ b/src/pages/contact.tsx @@ -41,7 +41,7 @@ const ContactPage: NextPage = () => { const { asPath } = useRouter(); const pageUrl = `${website.url}${asPath}`; const pagePublicationDate = new Date(dates.publication); - const pageUpdateDate = new Date(dates.update); + const pageUpdateDate = dates.update ? new Date(dates.update) : undefined; const webpageSchema: WebPage = { '@id': `${pageUrl}`, @@ -64,7 +64,7 @@ const ContactPage: NextPage = () => { author: { '@id': `${website.url}/#branding` }, creator: { '@id': `${website.url}/#branding` }, dateCreated: pagePublicationDate.toISOString(), - dateModified: pageUpdateDate.toISOString(), + dateModified: pageUpdateDate && pageUpdateDate.toISOString(), datePublished: pagePublicationDate.toISOString(), editor: { '@id': `${website.url}/#branding` }, inLanguage: website.locales.default, -- cgit v1.2.3