Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add missing canonical tags #331

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 50 additions & 27 deletions components/common/layout/SEO/SEO.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,64 @@ interface HeadProps {
noindex: boolean
}

const OgData:FC<HeadProps> = ({
const OgData: FC<HeadProps> = ({
ogTitle,
ogDescription,
ogImageUrl,
ogUrl,
noindex
noindex,
}) => {
const currentUrl = typeof window !== 'undefined' ? window.location.href : ''
return (
<Head>
<title>{ogTitle || "Open Sauced"}</title>
<meta name="title" content={ogTitle || "Open Sauced"}></meta>
<meta name="description" content={ogDescription || "The open-source intelligence platform for contributors and maintainers."} />
<link rel="icon" href="/favicon.svg" />
<Head>
<title>{ogTitle || 'Open Sauced'}</title>
<meta name="title" content={ogTitle || 'Open Sauced'}></meta>
<meta
name="description"
content={
ogDescription ||
'The open-source intelligence platform for contributors and maintainers.'
}
/>
<link rel="icon" href="/favicon.svg" />
<link rel="canonical" href={ogUrl || currentUrl} />

{/* <!-- Open Graph / Facebook --> */}
<meta property="og:type" content="website" />
<meta property="og:url" content={ogUrl || "https://opensauced.pizza"} />
<meta property="og:title" content={ogTitle || "Open Sauced"} />
<meta property="og:description" content={ogDescription || "The open-source intelligence platform for contributors and maintainers."} />
<meta
property="og:image"
content={ogImageUrl as unknown as string || ""}
/>
{/* <!-- Open Graph / Facebook --> */}
<meta property="og:type" content="website" />
<meta property="og:url" content={ogUrl || 'https://opensauced.pizza'} />
<meta property="og:title" content={ogTitle || 'Open Sauced'} />
<meta
property="og:description"
content={
ogDescription ||
'The open-source intelligence platform for contributors and maintainers.'
}
/>
<meta
property="og:image"
content={(ogImageUrl as unknown as string) || ''}
/>

{/* <!-- Twitter --> */}
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content={ogUrl || "https://opensauced.pizza/"} />
<meta property="twitter:title" content={ogTitle || "Open Sauced"} />
<meta property="twitter:description" content={ogDescription || "The open-source intelligence platform for contributors and maintainers."} />
<meta
property="twitter:image"
content={ogImageUrl as unknown as string || ""}
></meta>
{noindex && <meta name="robots" content="noindex" key="noindex" />}
</Head>
{/* <!-- Twitter --> */}
<meta property="twitter:card" content="summary_large_image" />
<meta
property="twitter:url"
content={ogUrl || 'https://opensauced.pizza/'}
/>
<meta property="twitter:title" content={ogTitle || 'Open Sauced'} />
<meta
property="twitter:description"
content={
ogDescription ||
'The open-source intelligence platform for contributors and maintainers.'
}
/>
<meta
property="twitter:image"
content={(ogImageUrl as unknown as string) || ''}
></meta>
{noindex && <meta name="robots" content="noindex" key="noindex" />}
</Head>
)
}

Expand Down