aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/PostPreview/PostPreview.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-02-21 19:34:01 +0100
committerGitHub <noreply@github.com>2022-02-21 19:34:01 +0100
commit17842893306410f878eed66af5e807870e61cc49 (patch)
tree57608ffb9374bb3bdbbe6b3c9903e6eaefa3c180 /src/components/PostPreview/PostPreview.tsx
parentf18fe8caa611e9273c5504fa81522e1ac93b95d2 (diff)
refactor: replace script tags with next/script (#10)
* refactor: replace script tags with next/script Since next.js v12.1.0 some warnings was displayed because I was using some script tags. * build(deps): bump next-themes to v0.1.1
Diffstat (limited to 'src/components/PostPreview/PostPreview.tsx')
-rw-r--r--src/components/PostPreview/PostPreview.tsx13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/components/PostPreview/PostPreview.tsx b/src/components/PostPreview/PostPreview.tsx
index 3fbfa63..8b20eca 100644
--- a/src/components/PostPreview/PostPreview.tsx
+++ b/src/components/PostPreview/PostPreview.tsx
@@ -5,11 +5,11 @@ import { TitleLevel } from '@ts/types/app';
import { ArticleMeta, ArticlePreview } from '@ts/types/articles';
import { settings } from '@utils/config';
import Image from 'next/image';
-import Head from 'next/head';
import Link from 'next/link';
import { FormattedMessage } from 'react-intl';
import { BlogPosting, WithContext } from 'schema-dts';
import styles from './PostPreview.module.scss';
+import Script from 'next/script';
const PostPreview = ({
post,
@@ -68,12 +68,11 @@ const PostPreview = ({
return (
<>
- <Head>
- <script
- type="application/ld+json"
- dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }}
- ></script>
- </Head>
+ <Script
+ id="schema-post-preview"
+ type="application/ld+json"
+ dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }}
+ />
<article className={styles.wrapper}>
{featuredImage && Object.keys(featuredImage).length > 0 && (
<div className={styles.cover}>