1
1
import { BlogPosting } from "schema-dts" ;
2
2
import { jsonLdScriptProps } from "react-schemaorg" ;
3
3
import config from "../../lib/config" ;
4
- import { parseISO , formatISO } from "date-fns" ;
4
+ import { formatISO } from "date-fns" ;
5
+ import Head from "next/head" ;
5
6
6
7
type Props = {
7
8
url : string ;
@@ -22,18 +23,20 @@ export default function JsonLdMeta({
22
23
description,
23
24
} : Props ) {
24
25
return (
25
- < script
26
- { ...jsonLdScriptProps < BlogPosting > ( {
27
- "@context" : "https://schema.org" ,
28
- "@type" : "BlogPosting" ,
29
- mainEntityOfPage : config . base_url + url ,
30
- headline : title ,
31
- keywords : keywords ? undefined : keywords . join ( "," ) ,
32
- datePublished : formatISO ( date ) ,
33
- author : author ,
34
- image : image ,
35
- description : description ,
36
- } ) }
37
- />
26
+ < Head >
27
+ < script
28
+ { ...jsonLdScriptProps < BlogPosting > ( {
29
+ "@context" : "https://schema.org" ,
30
+ "@type" : "BlogPosting" ,
31
+ mainEntityOfPage : config . base_url + url ,
32
+ headline : title ,
33
+ keywords : keywords ? undefined : keywords . join ( "," ) ,
34
+ datePublished : formatISO ( date ) ,
35
+ author : author ,
36
+ image : image ,
37
+ description : description ,
38
+ } ) }
39
+ />
40
+ </ Head >
38
41
) ;
39
42
}
0 commit comments