forked from craigary/nobelium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Container.js
91 lines (88 loc) · 2.93 KB
/
Container.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import Header from '@/components/Header'
import Footer from '@/components/Footer'
import BLOG from '@/blog.config'
import Head from 'next/head'
import PropTypes from 'prop-types'
// import BlogPost from './BlogPost'
const Container = ({ children, layout, fullWidth, ...customMeta }) => {
const url = BLOG.path.length ? `${BLOG.link}/${BLOG.path}` : BLOG.link
const meta = {
title: BLOG.title,
type: 'website',
...customMeta
}
return (
<div>
<Head>
<title>{meta.title}</title>
{/* <meta content={BLOG.darkBackground} name="theme-color" /> */}
<meta name="robots" content="follow, index" />
<meta charSet="UTF-8" />
{BLOG.seo.googleSiteVerification && (
<meta
name="google-site-verification"
content={BLOG.seo.googleSiteVerification}
/>
)}
{BLOG.seo.keywords && (
<meta name="keywords" content={BLOG.seo.keywords.join(', ')} />
)}
<meta name="description" content={meta.description} />
<meta property="og:locale" content={BLOG.lang} />
<meta property="og:title" content={meta.title} />
<meta property="og:description" content={meta.description} />
<meta
property="og:url"
content={meta.slug ? `${url}/${meta.slug}` : url}
/>
<meta
property="og:image"
content={`${BLOG.ogImageGenerateURL}/${encodeURIComponent(
meta.title
)}.png?theme=dark&md=1&fontSize=125px&images=https%3A%2F%2Fnobelium.vercel.app%2Flogo-for-dark-bg.svg`}
/>
<meta property="og:type" content={meta.type} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:description" content={meta.description} />
<meta name="twitter:title" content={meta.title} />
<meta
name="twitter:image"
content={`${BLOG.ogImageGenerateURL}/${encodeURIComponent(
meta.title
)}.png?theme=dark&md=1&fontSize=125px&images=https%3A%2F%2Fnobelium.vercel.app%2Flogo-for-dark-bg.svg`}
/>
{meta.type === 'article' && (
<>
<meta
property="article:published_time"
content={meta.date || meta.createdTime}
/>
<meta property="article:author" content={BLOG.author} />
</>
)}
</Head>
<div
className={`wrapper ${
BLOG.font === 'serif' ? 'font-serif' : 'font-sans'
}`}
>
<Header
navBarTitle={layout === 'blog' ? meta.title : null}
fullWidth={fullWidth}
/>
<main
className={`m-auto flex-grow w-full transition-all ${
!fullWidth ? 'max-w-2xl px-4' : 'px-4 md:px-24'
}`}
>
{children}
</main>
<Footer fullWidth={fullWidth} />
</div>
</div>
)
}
Container.propTypes = {
children: PropTypes.node
}
export default Container