@@ -27,16 +27,53 @@ type PageTemplateProps = {
2727 t : Translate ;
2828 title : string ;
2929 children : ReactNode ;
30+ meta ?: Record < string , string > ;
3031} ;
3132
32- export function PageTemplate ( { t, title, children } : PageTemplateProps ) {
33+ const metaTags = {
34+ author : 'Luís Takahashi' ,
35+ url :
36+ 'https://res.cloudinary.com/daiqkausy/image/upload/c_scale,w_200/v1604365911/me.jpg' ,
37+ image_url :
38+ 'https://res.cloudinary.com/daiqkausy/image/upload/c_scale,w_200/v1604365911/me.jpg' ,
39+ } ;
40+
41+ export function PageTemplate ( { t, title, meta, children } : PageTemplateProps ) {
3342 return (
3443 < ThemeProvider theme = { tokens } >
3544 < Page >
3645 < GlobalStyles />
3746 < Head >
3847 < title > { title } </ title >
3948 < link rel = "icon" href = "/favicon.png" />
49+ < meta name = "robots" content = "index, follow" />
50+ < meta
51+ name = "viewport"
52+ content = "width=device-width,initial-scale=1.0"
53+ />
54+
55+ < meta property = "og:type" content = "blog" />
56+ < meta property = "og:title" content = { title } />
57+ < meta property = "og:url" content = { metaTags . url } />
58+ < meta property = "og:image" content = { metaTags . image_url } />
59+ < meta property = "og:site_name" content = { metaTags . author } />
60+
61+ < meta name = "twitter:title" content = { title } />
62+ < meta name = "twitter:image" content = { metaTags . image_url } />
63+ < meta name = "twitter:site" content = { metaTags . author } />
64+ < meta name = "twitter:creator" content = { metaTags . author } />
65+ { meta ?. description ? (
66+ < >
67+ < meta name = "twitter:description" content = { meta ?. description } />
68+ < meta property = "og:description" content = { meta ?. description } />
69+ </ >
70+ ) : null }
71+
72+ { meta
73+ ? Object . entries ( meta ) . map ( ( [ name , content ] ) => (
74+ < meta key = { name } name = { name } content = { content } />
75+ ) )
76+ : null }
4077 </ Head >
4178 < Languages />
4279 < Main > { children } </ Main >
0 commit comments