-
Notifications
You must be signed in to change notification settings - Fork 0
/
Base.tsx
60 lines (55 loc) · 2.42 KB
/
Base.tsx
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
import Head from "next/head";
import { useRouter } from "next/router";
import Navbar from "./Navigation";
export function ContainerBlock({
title,
description,
children,
type,
image,
publishedDate,
}: {
title: string | undefined,
description: string | undefined,
children: React.ReactNode,
type?: string,
image?: string,
publishedDate?: string,
}) {
// Fetch the router
const router = useRouter();
const meta = {
title: title !== undefined ? title : "Behn Hayhoe - Developer, Systems Engineer, and Solutions Designer",
description: description !== undefined ? description : "Hey 👋, I'm Behn - a passionate Software Engineer and Technology enthusiast.",
image: image !== undefined ? image : "https://behn.dev/wordmark.png",
type: type !== undefined ? type : "website",
};
return (
<div className="z-100">
<Head>
{/* Standard Meta information */}
<title>{meta.title}</title>
<meta name="robots" content="index, follow" />
<meta name="description" content={meta.description} />
<meta property="og:url" content={`https://behn.dev${router.asPath}`} />
<link rel="canonical" href={`https://behn.dev${router.asPath}`} />
{/* Open Graph Meta information */}
<meta property="og:title" content={meta.title} />
<meta property="og:description" content={meta.description} />
<meta property="og:image" content={meta.image} />
<meta property="og:type" content={meta.type} />
<meta property="og:published_time" content={publishedDate} />
{/* Twitter Meta information */}
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={meta.title} />
<meta name="twitter:description" content={meta.description} />
<meta name="twitter:image" content={meta.image} />
<meta name="twitter:site" content="@BehnH" />
</Head>
<main className="w-full relative overflow-visible">
<Navbar />
<div>{children}</div>
</main>
</div>
);
}