diff options
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/contact.tsx | 4 | ||||
| -rw-r--r-- | src/pages/cv.tsx | 26 | ||||
| -rw-r--r-- | src/pages/index.tsx | 12 | ||||
| -rw-r--r-- | src/pages/mentions-legales.tsx | 26 | 
4 files changed, 19 insertions, 49 deletions
| 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, diff --git a/src/pages/cv.tsx b/src/pages/cv.tsx index d47edc6..0e4765e 100644 --- a/src/pages/cv.tsx +++ b/src/pages/cv.tsx @@ -7,7 +7,6 @@ import PageLayout, {  } from '@components/templates/page/page-layout';  import CVContent, { data, meta } from '@content/pages/cv.mdx';  import styles from '@styles/pages/cv.module.scss'; -import { getFormattedDate } from '@utils/helpers/dates';  import { loadTranslation } from '@utils/helpers/i18n';  import useSettings from '@utils/hooks/use-settings';  import { GetStaticProps, NextPage } from 'next'; @@ -46,24 +45,15 @@ const CVPage: NextPage = () => {      id: '+Dre5J',    }); -  const publicationLabel = intl.formatMessage({ -    defaultMessage: 'Published on:', -    description: 'Meta: publication date label', -    id: 'QGi5uD', -  }); - -  const updateLabel = intl.formatMessage({ -    defaultMessage: 'Updated on:', -    description: 'Meta: update date label', -    id: 'tLC7bh', -  }); -    const headerMeta: PageLayoutProps['headerMeta'] = {      publication: { -      name: publicationLabel, -      value: getFormattedDate(dates.publication), +      date: dates.publication,      }, -    update: { name: updateLabel, value: getFormattedDate(dates.update) }, +    update: dates.update +      ? { +          date: dates.update, +        } +      : undefined,    };    const { website } = useSettings(); @@ -118,7 +108,7 @@ const CVPage: 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}`, @@ -141,7 +131,7 @@ const CVPage: 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` },      image: image.src, diff --git a/src/pages/index.tsx b/src/pages/index.tsx index c965320..6108d2f 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -225,17 +225,7 @@ const HomePage: NextPage<HomeProps> = ({ recentPosts }) => {        return {          cover: post.cover,          id: post.slug, -        meta: [ -          { -            id: 'publication', -            term: intl.formatMessage({ -              defaultMessage: 'Published on:', -              description: 'HomePage: publication date label', -              id: 'pT5nHk', -            }), -            value: [post.dates.publication], -          }, -        ], +        meta: { publication: { date: post.dates.publication } },          title: post.title,          url: `/article/${post.slug}`,        }; diff --git a/src/pages/mentions-legales.tsx b/src/pages/mentions-legales.tsx index 8dd0a1d..9235e69 100644 --- a/src/pages/mentions-legales.tsx +++ b/src/pages/mentions-legales.tsx @@ -5,7 +5,6 @@ import PageLayout, {    type PageLayoutProps,  } from '@components/templates/page/page-layout';  import LegalNoticeContent, { meta } from '@content/pages/legal-notice.mdx'; -import { getFormattedDate } from '@utils/helpers/dates';  import { loadTranslation } from '@utils/helpers/i18n';  import useSettings from '@utils/hooks/use-settings';  import { NestedMDXComponents } from 'mdx/types'; @@ -32,24 +31,15 @@ const LegalNoticePage: NextPage = () => {      { id: 'legal-notice', name: title, url: '/mentions-legales' },    ]; -  const publicationLabel = intl.formatMessage({ -    defaultMessage: 'Published on:', -    description: 'Meta: publication date label', -    id: 'QGi5uD', -  }); - -  const updateLabel = intl.formatMessage({ -    defaultMessage: 'Updated on:', -    description: 'Meta: update date label', -    id: 'tLC7bh', -  }); -    const headerMeta: PageLayoutProps['headerMeta'] = {      publication: { -      name: publicationLabel, -      value: getFormattedDate(dates.publication), +      date: dates.publication,      }, -    update: { name: updateLabel, value: getFormattedDate(dates.update) }, +    update: dates.update +      ? { +          date: dates.update, +        } +      : undefined,    };    const components: NestedMDXComponents = { @@ -61,7 +51,7 @@ const LegalNoticePage: 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}`, @@ -87,7 +77,7 @@ const LegalNoticePage: NextPage = () => {      copyrightYear: pagePublicationDate.getFullYear(),      creator: { '@id': `${website.url}/#branding` },      dateCreated: pagePublicationDate.toISOString(), -    dateModified: pageUpdateDate.toISOString(), +    dateModified: pageUpdateDate && pageUpdateDate.toISOString(),      datePublished: pagePublicationDate.toISOString(),      editor: { '@id': `${website.url}/#branding` },      headline: title, | 
