1
1
import { Flex , List , ListItem , Stack , Text } from '@chakra-ui/react' ;
2
2
import type { InferGetStaticPropsType , GetStaticProps } from 'next' ;
3
+ import Head from 'next/head' ;
3
4
import Link from 'next/link' ;
4
5
5
6
type Posts = {
@@ -19,32 +20,45 @@ export const getStaticProps = (async (context) => {
19
20
20
21
export default function Page ( { posts } : InferGetStaticPropsType < typeof getStaticProps > ) {
21
22
return (
22
- < Flex maxWidth = { '1200px' } mx = { 'auto' } w = { 'full' } p = { 2 } justify = { 'center' } flexDir = { 'column' } >
23
- < Stack mt = { 6 } >
24
- < Text as = { 'h1' } fontSize = { '3xl' } fontWeight = { 'bold' } >
25
- Blogs
26
- </ Text >
27
- </ Stack >
28
- < List mt = { '6' } w = { 'full' } >
29
- { posts . map ( ( post , idx ) => (
30
- < Link href = { `/blogs/${ post . id } ` } key = { idx } >
31
- < ListItem
32
- p = { 4 }
33
- rounded = { 'md' }
34
- border = { '1px solid var(--border-color)' }
35
- fontSize = { 'xl' }
36
- fontWeight = { 'medium' }
37
- _hover = { {
38
- bg : 'var(--card-dark-color)' ,
39
- cursor : 'pointer'
40
- } }
41
- my = { 3 }
42
- bg = { 'var(--card-color)' } >
43
- { post . title . rendered }
44
- </ ListItem >
45
- </ Link >
46
- ) ) }
47
- </ List >
48
- </ Flex >
23
+ < >
24
+ < Head >
25
+ < title > Blogs</ title >
26
+ < meta
27
+ name = "description"
28
+ content = "Discover leading educational blogs that provide insights and knowledge on various topics."
29
+ />
30
+ </ Head >
31
+ < Flex maxWidth = { '1200px' } mx = { 'auto' } w = { 'full' } p = { 2 } justify = { 'center' } flexDir = { 'column' } >
32
+ < Stack mt = { 6 } >
33
+ < Text as = "h1" fontSize = "3xl" fontWeight = "bold" >
34
+ Blogs
35
+ </ Text >
36
+ < Text fontSize = "lg" color = "gray.600" >
37
+ Explore our collection of blogs that cover a wide range of educational topics, designed
38
+ to inform and inspire you.
39
+ </ Text >
40
+ </ Stack >
41
+ < List mt = { '6' } w = { 'full' } >
42
+ { posts . map ( ( post , idx ) => (
43
+ < Link href = { `/blogs/${ post . id } ` } key = { idx } >
44
+ < ListItem
45
+ p = { 4 }
46
+ rounded = { 'md' }
47
+ border = { '1px solid var(--border-color)' }
48
+ fontSize = { 'xl' }
49
+ fontWeight = { 'medium' }
50
+ _hover = { {
51
+ bg : 'var(--card-dark-color)' ,
52
+ cursor : 'pointer'
53
+ } }
54
+ my = { 3 }
55
+ bg = { 'var(--card-color)' } >
56
+ { post . title . rendered }
57
+ </ ListItem >
58
+ </ Link >
59
+ ) ) }
60
+ </ List >
61
+ </ Flex >
62
+ </ >
49
63
) ;
50
64
}
0 commit comments