@@ -3,9 +3,19 @@ import Entry from "../components/Entry"
3
3
import Layout from "../components/Layout"
4
4
import PostCard from "../components/PostCard"
5
5
import { getAllPosts } from "../lib/posts"
6
- import { Post } from "../lib/types"
6
+ import { PostMeta } from "../lib/types"
7
7
8
- export default function Blog ( { posts, postCount, postsByYear, years } ) {
8
+ export default function Blog ( {
9
+ posts,
10
+ postCount,
11
+ postsByYear,
12
+ years,
13
+ } : {
14
+ posts : PostMeta [ ]
15
+ postCount : number
16
+ postsByYear : any
17
+ years : string [ ]
18
+ } ) {
9
19
return (
10
20
< >
11
21
< Layout title = "Blog | Max Petretta" >
@@ -31,7 +41,7 @@ export default function Blog({ posts, postCount, postsByYear, years }) {
31
41
< h2 className = "mb-0" > { year } </ h2 >
32
42
< hr className = "mt-2 mb-8 md:mt-3 md:mb-10" />
33
43
< ul className = "list" >
34
- { postsByYear [ year ] . map ( ( post : Post ) => {
44
+ { postsByYear [ year ] . map ( ( post : PostMeta ) => {
35
45
return < Entry key = { post . slug } post = { post } />
36
46
} ) }
37
47
</ ul >
@@ -47,7 +57,7 @@ export default function Blog({ posts, postCount, postsByYear, years }) {
47
57
export const getStaticProps : GetStaticProps = async ( ) => {
48
58
const posts = getAllPosts ( ) . reverse ( )
49
59
const postCount = posts . length
50
- let postsByYear = { }
60
+ let postsByYear : any = { }
51
61
52
62
posts . map ( ( post ) => {
53
63
const year = post . date . split ( "-" ) [ 0 ]
@@ -61,7 +71,7 @@ export const getStaticProps: GetStaticProps = async () => {
61
71
}
62
72
}
63
73
64
- export function getFeaturedPosts ( posts : Post [ ] ) : Post [ ] {
74
+ export function getFeaturedPosts ( posts : PostMeta [ ] ) : PostMeta [ ] {
65
75
const featured = [ "twitt3r" , "tech-stack" ]
66
76
67
77
const sorted = posts
0 commit comments