diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-19 15:50:23 +0100 | 
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-19 15:50:23 +0100 | 
| commit | a16d23dcde76874fab4b6bdb45067fd01b88cdc1 (patch) | |
| tree | 540cfed27a1200ed6bdbc3a445d6dd8a4dc969fb /src/pages/contact.tsx | |
| parent | 1fa8d8281371db25ef9382b6087b7f3c0db73fe3 (diff) | |
chore: add opengraph and twitter meta
Diffstat (limited to 'src/pages/contact.tsx')
| -rw-r--r-- | src/pages/contact.tsx | 11 | 
1 files changed, 8 insertions, 3 deletions
| diff --git a/src/pages/contact.tsx b/src/pages/contact.tsx index 659da8a..66f4f9e 100644 --- a/src/pages/contact.tsx +++ b/src/pages/contact.tsx @@ -58,15 +58,16 @@ const ContactPage: NextPageWithLayout = () => {    const title = t`Contact`;    const intro = t`Please fill the form to contact me.`; +  const pageUrl = `${config.url}${router.asPath}`;    const webpageSchema: WebPage = { -    '@id': `${config.url}${router.asPath}`, +    '@id': `${pageUrl}`,      '@type': 'WebPage',      breadcrumb: { '@id': `${config.url}/#breadcrumb` },      name: seo.contact.title,      description: seo.contact.description,      reviewedBy: { '@id': `${config.url}/#branding` }, -    url: `${config.url}${router.asPath}`, +    url: `${pageUrl}`,      isPartOf: {        '@id': `${config.url}`,      }, @@ -82,7 +83,7 @@ const ContactPage: NextPageWithLayout = () => {      editor: { '@id': `${config.url}/#branding` },      inLanguage: config.locales.defaultLocale,      license: 'https://creativecommons.org/licenses/by-sa/4.0/deed.fr', -    mainEntityOfPage: { '@id': `${config.url}${router.asPath}` }, +    mainEntityOfPage: { '@id': `${pageUrl}` },    };    const schemaJsonLd: Graph = { @@ -95,6 +96,10 @@ const ContactPage: NextPageWithLayout = () => {        <Head>          <title>{seo.contact.title}</title>          <meta name="description" content={seo.contact.description} /> +        <meta property="og:url" content={`${pageUrl}`} /> +        <meta property="og:type" content="article" /> +        <meta property="og:title" content={title} /> +        <meta property="og:description" content={intro} />          <script            type="application/ld+json"            dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }} | 
