11import Head from "next/head"
2+ import { withRouter , WithRouterProps } from "next/router"
23
34import { IMeta } from "*.mdx"
5+ import { AVATAR_PATHNAME , FB_APP_ID , SITE_NAME } from "../../constants"
46import SingleCol from "../SingleCol/SingleCol"
57import Header from "../Header/Header"
68
@@ -10,9 +12,21 @@ interface IProps extends IMeta {
1012 children : React . ReactNode
1113}
1214
13- const BlogPage = ( props : IProps ) => (
15+ const BlogPage = withRouter ( ( props : WithRouterProps & IProps ) => (
1416 < div >
1517 < Head >
18+ < title >
19+ { props . title } - { SITE_NAME }
20+ </ title >
21+ < meta name = "description" content = { props . description } />
22+ < meta name = "twitter:card" content = "summary" />
23+ < meta name = "twitter:creator" content = "@yuku_t" />
24+ < meta property = "fb:app_id" content = { FB_APP_ID } />
25+ < meta property = "og:title" content = { `${ props . title } - ${ SITE_NAME } ` } />
26+ < meta property = "og:type" content = "article" />
27+ < meta property = "og:url" content = { `https://yuku.takahashi.coffee${ props . router ! . pathname } ` } />
28+ < meta property = "og:image" content = { props . ogImage || `https://yuku.takahashi.coffee${ AVATAR_PATHNAME } ` } />
29+ < meta property = "og:description" content = { props . description } />
1630 < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/themes/prism.min.css" />
1731 < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css" />
1832 </ Head >
@@ -27,6 +41,6 @@ const BlogPage = (props: IProps) => (
2741 < div className = "blogpage" > { props . children } </ div >
2842 </ SingleCol >
2943 </ div >
30- )
44+ ) )
3145
3246export default BlogPage
0 commit comments