Skip to content

Commit 1cd84f3

Browse files
committed
Add more metadata
1 parent 767b09e commit 1cd84f3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

components/Layout.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface OpenGraph {
99
image: string;
1010
type: string;
1111
url: string;
12+
description: string;
1213
}
1314

1415
interface LayoutProps {
@@ -22,13 +23,14 @@ const Layout: React.FC<LayoutProps> = ({
2223
}) => (
2324
<>
2425
<Head>
25-
<title>William Edmisten</title>
26-
<meta name="description" content="William Edmisten" />
26+
<title>{opengraph?.title || "William Edmisten"}</title>
27+
<meta name="description" content={opengraph?.description || "William Edmisten's personal developer blog."} />
2728
{opengraph && <>
2829
<meta property="og:title" content={opengraph.title} />
2930
<meta property="og:type" content={opengraph.type} />
3031
<meta property="og:image" content={opengraph.image} />
3132
<meta property="og:url" content={opengraph.url} />
33+
{opengraph?.description && <meta property="og:description" content={opengraph.description} />}
3234
</>}
3335
<link rel="icon" href="/favicon.ico" />
3436
<link

pages/post/[pid].tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ export async function getStaticProps({ params }: { params: any }) {
116116
title: meta.title,
117117
image: `https://wcedmisten.fyi${meta.thumbnail}`,
118118
type: "article",
119-
url: `https://wcedmisten.fyi/post/${source.filename}/`
119+
url: `https://wcedmisten.fyi/post/${source.filename}/`,
120+
description: meta.description
120121
}
121122
},
122123
}

0 commit comments

Comments
 (0)