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/blog | |
| parent | 1fa8d8281371db25ef9382b6087b7f3c0db73fe3 (diff) | |
chore: add opengraph and twitter meta
Diffstat (limited to 'src/pages/blog')
| -rw-r--r-- | src/pages/blog/index.tsx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/pages/blog/index.tsx b/src/pages/blog/index.tsx index bb16d37..3b3f2c2 100644 --- a/src/pages/blog/index.tsx +++ b/src/pages/blog/index.tsx @@ -62,8 +62,11 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ fallback }) => { return <PostsList ref={lastPostRef} data={data} showYears={true} />; }; + const title = t`Blog`; + 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.blog.title, @@ -84,7 +87,7 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ fallback }) => { 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 = { @@ -97,6 +100,10 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ fallback }) => { <Head> <title>{seo.blog.title}</title> <meta name="description" content={seo.blog.description} /> + <meta property="og:url" content={`${pageUrl}`} /> + <meta property="og:type" content="website" /> + <meta property="og:title" content={title} /> + <meta property="og:description" content={seo.blog.description} /> <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }} @@ -106,7 +113,7 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ fallback }) => { id="blog" className={`${styles.article} ${styles['article--no-comments']}`} > - <PostHeader title={t`Blog`} /> + <PostHeader title={title} /> <div className={styles.body}> {getPostsList()} {hasNextPage && ( |
