Skip to content

Commit

Permalink
Added Open Graph images to proper link tag, added new archive link fo…
Browse files Browse the repository at this point in the history
…r v2
  • Loading branch information
braydoncoyer committed Dec 10, 2022
1 parent 2f587b1 commit 4f91141
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
26 changes: 16 additions & 10 deletions layouts/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ export function Container(props) {
property="og:url"
content={`${siteMetadata.siteUrl}${router.asPath}`}
/>
<meta
property="og:url"
content={`${siteMetadata.siteUrl}/api/og?title=${encodeURIComponent(
meta.title
)}${meta.isArticle ? '&article' : ''}${
meta.imageUrl ? `&imgSrc=${meta.imageUrl}` : ''
}&description=${encodeURIComponent(meta.description)}`}
/>
<meta name="application-name" content="&nbsp;" />
<meta name="msapplication-TileColor" content="#FFFFFF" />
<meta
Expand Down Expand Up @@ -72,12 +64,26 @@ export function Container(props) {
<meta property="og:site_name" content="Braydon Coyer" />
<meta property="og:description" content={meta.description} />
<meta property="og:title" content={meta.title} />
<meta property="og:image" content={meta.imageUrl} />
<meta
property="og:image"
content={`${siteMetadata.siteUrl}/api/og?title=${encodeURIComponent(
meta.title
)}${meta.isArticle ? '&article' : ''}${
meta.imageUrl ? `&imgSrc=${meta.imageUrl}` : ''
}&description=${encodeURIComponent(meta.description)}`}
/>
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content={meta.twitterHandle} />
<meta name="twitter:title" content={meta.title} />
<meta name="twitter:description" content={meta.description} />
<meta name="twitter:image" content={meta.imageUrl} />
<meta
name="twitter:image"
content={`${siteMetadata.siteUrl}/api/og?title=${encodeURIComponent(
meta.title
)}${meta.isArticle ? '&article' : ''}${
meta.imageUrl ? `&imgSrc=${meta.imageUrl}` : ''
}&description=${encodeURIComponent(meta.description)}`}
/>
{meta.date && (
<meta property="article:published_time" content={meta.date} />
)}
Expand Down
5 changes: 5 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ module.exports = {
source: '/archives/v1',
destination: 'https://wizardly-payne-b3707b.netlify.app/',
permanent: true
},
{
source: '/archives/v2',
destination: 'https://braydoncoyer-2hvriu779-braydon-coyer.vercel.app/',
permanent: true
}
];
},
Expand Down

1 comment on commit 4f91141

@vercel
Copy link

@vercel vercel bot commented on 4f91141 Dec 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.