1
1
import { GetServerSideProps } from "next" ;
2
2
import Head from "next/head" ;
3
- import { dateToPtbr , getContent , getFooter , getImgUrl , getIntroduction , getTitle } from "../../helpers/util" ;
3
+ import { dateToPtbr , getContent , getFooter , getImgUrl , getIntroduction , getKeywords , getPreviewText , getTitle } from "../../helpers/util" ;
4
4
import { api_id , GET_PRISMIC_CLIENT } from "../../services/prismic" ;
5
5
import styles from './post.module.scss' ;
6
6
@@ -13,6 +13,8 @@ interface PostProps {
13
13
image_banner : string ;
14
14
footer : string ;
15
15
updatedAt : string ;
16
+ keywords : string ;
17
+ previewText : string ;
16
18
}
17
19
}
18
20
@@ -21,6 +23,9 @@ export default function Post({ post }: PostProps) {
21
23
< >
22
24
< Head >
23
25
< title > { post . title } | lostCode</ title >
26
+ < meta name = 'description' content = { post . previewText } />
27
+ < meta name = 'keywords' content = { post . keywords } />
28
+
24
29
</ Head >
25
30
26
31
< main className = { styles . container } >
@@ -59,6 +64,8 @@ export const getServerSideProps: GetServerSideProps = async ({ req, params }) =>
59
64
image_banner : getImgUrl ( response ) ,
60
65
updatedAt : dateToPtbr ( response . last_publication_date ) ,
61
66
footer : getFooter ( response ) ,
67
+ keywords : getKeywords ( response ) ,
68
+ previewText : getPreviewText ( response ) ,
62
69
}
63
70
64
71
return {
0 commit comments