Skip to content

Commit

Permalink
Dynamic SEO tags (#75)
Browse files Browse the repository at this point in the history
* Add dynamic metadata for SEO
  • Loading branch information
CarolinaCobo authored Oct 24, 2022
1 parent 6d283db commit 609252f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pages/articles/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ const ArticlePage: NextPage = ({
<>
<Head>
<title>Codú | {post.title}</title>
<meta key="og:title" property="og:title" content={post.title} />
<meta
key="og:description"
property="og:description"
content={post.excerpt}
/>
<meta key="description" property="description" content={post.excerpt} />
<meta property="og:type" content="article" />
<meta
property="og:url"
content={`https://codu.co/articles/${post.slug}`}
/>
</Head>
<Layout>
<div className="border-t-2">
Expand Down Expand Up @@ -65,6 +77,8 @@ export const getServerSideProps = async (
id: true,
title: true,
body: true,
excerpt: true,
slug: true,
user: {
select: {
name: true,
Expand Down

0 comments on commit 609252f

Please sign in to comment.