Skip to content

Commit

Permalink
Add more metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
wcedmisten committed Feb 19, 2024
1 parent 767b09e commit 1cd84f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface OpenGraph {
image: string;
type: string;
url: string;
description: string;
}

interface LayoutProps {
Expand All @@ -22,13 +23,14 @@ const Layout: React.FC<LayoutProps> = ({
}) => (
<>
<Head>
<title>William Edmisten</title>
<meta name="description" content="William Edmisten" />
<title>{opengraph?.title || "William Edmisten"}</title>
<meta name="description" content={opengraph?.description || "William Edmisten's personal developer blog."} />
{opengraph && <>
<meta property="og:title" content={opengraph.title} />
<meta property="og:type" content={opengraph.type} />
<meta property="og:image" content={opengraph.image} />
<meta property="og:url" content={opengraph.url} />
{opengraph?.description && <meta property="og:description" content={opengraph.description} />}
</>}
<link rel="icon" href="/favicon.ico" />
<link
Expand Down
3 changes: 2 additions & 1 deletion pages/post/[pid].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export async function getStaticProps({ params }: { params: any }) {
title: meta.title,
image: `https://wcedmisten.fyi${meta.thumbnail}`,
type: "article",
url: `https://wcedmisten.fyi/post/${source.filename}/`
url: `https://wcedmisten.fyi/post/${source.filename}/`,
description: meta.description
}
},
}
Expand Down

0 comments on commit 1cd84f3

Please sign in to comment.