Skip to content

Commit

Permalink
fix: og title
Browse files Browse the repository at this point in the history
  • Loading branch information
shadcn committed Nov 28, 2022
1 parent 0629b9e commit e439117
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ export default function Head() {
name="description"
content="An open source application built using the new router, server components and everything new in Next.js 13."
/>

<meta property="og:title" content="Taxonomy" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://tx.shadcn.com" />
<meta property="og:image" content="https://tx.shadcn.com/og.jpg" />
<meta property="twitter:title" content="Taxonomy" />
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://tx.shadcn.com" />
<meta property="twitter:image" content="https://tx.shadcn.com/og.jpg" />
Expand Down
2 changes: 1 addition & 1 deletion components/docs/mdx-head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function MdxHead({ params, og }: MdxHeadProps) {
const url = process.env.NEXT_PUBLIC_APP_URL
let ogUrl = new URL(`${url}/og.jpg`)

if (og.type) {
if (og?.type) {
ogUrl = new URL(`${url}/api/og`)
ogUrl.searchParams.set("heading", og.heading || mdxDoc.title)
ogUrl.searchParams.set("type", og.type)
Expand Down

0 comments on commit e439117

Please sign in to comment.