1
- import type { GetStaticProps } from ' next' ;
2
- import type { PostPreview } from ' ../types/PostPreview' ;
3
- import Head from ' next/head' ;
4
- import Preview from ' ../components/Preview' ;
5
- import postList from ' ../lib/getPosts' ;
1
+ import type { GetStaticProps } from " next" ;
2
+ import type { PostPreview } from " ../types/PostPreview" ;
3
+ import Head from " next/head" ;
4
+ import Preview from " ../components/Preview" ;
5
+ import postList from " ../lib/getPosts" ;
6
6
7
7
const Home = ( postList : { posts : [ PostPreview ] } ) => {
8
8
return (
9
9
< >
10
10
< Head >
11
11
< title > wb's blog</ title >
12
12
< meta name = "description" content = "my site" />
13
+ < link rel = "icon" href = "favicon.ico" />
14
+ < link rel = "shortcut icon" href = "favicon.ico" />
15
+ < meta property = "og:title" content = "wrongbyte.github.io" />
16
+ < meta property = "og:description" content = "my random tech stuff" />
17
+ < meta
18
+ property = "og:image"
19
+ content = "https://pbs.twimg.com/media/FMfaMdVUYAAtgp2?format=jpg& name = large "
20
+ />
21
+ < meta name = "twitter:title" content = "wrongbyte.github.io" />
22
+ < meta name = "twitter:description" content = "my random tech stuff" />
23
+ < meta
24
+ name = "twitter:image"
25
+ content = "https://pbs.twimg.com/media/FMfaMdVUYAAtgp2?format=jpg& name = large "
26
+ />
13
27
</ Head >
14
28
< section >
15
29
{ postList . posts . map ( ( post ) => (
16
30
< Preview
17
- key = { post . title }
18
- description = { post . description }
19
- title = { post . title }
20
- date = { post . date }
21
- slug = { post . slug }
31
+ key = { post . title }
32
+ description = { post . description }
33
+ title = { post . title }
34
+ date = { post . date }
35
+ slug = { post . slug }
22
36
/>
23
37
) ) }
24
38
</ section >
25
39
</ >
26
- )
27
- }
40
+ ) ;
41
+ } ;
28
42
29
43
export const getStaticProps : GetStaticProps = async ( context ) => {
30
44
return {
@@ -33,10 +47,10 @@ export const getStaticProps: GetStaticProps = async (context) => {
33
47
title : post . title ,
34
48
description : post . description ,
35
49
date : post . date . toDateString ( ) ,
36
- slug : post . slug
37
- } ) )
38
- }
39
- }
40
- }
50
+ slug : post . slug ,
51
+ } ) ) ,
52
+ } ,
53
+ } ;
54
+ } ;
41
55
42
- export default Home
56
+ export default Home ;
0 commit comments