Fix prerender
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { Helmet } from 'react-helmet'
|
import { Helmet } from 'react-helmet'
|
||||||
|
import { useIsBrowser } from '@redwoodjs/prerender/browserUtils'
|
||||||
|
|
||||||
const Seo = ({
|
const Seo = ({
|
||||||
title = "CadHub",
|
title = "CadHub",
|
||||||
@@ -11,6 +12,7 @@ const Seo = ({
|
|||||||
lang: string
|
lang: string
|
||||||
socialImageUrl?: string
|
socialImageUrl?: string
|
||||||
}) => {
|
}) => {
|
||||||
|
const browser = useIsBrowser()
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Helmet
|
<Helmet
|
||||||
@@ -24,7 +26,7 @@ const Seo = ({
|
|||||||
<meta name="description" content={description} />
|
<meta name="description" content={description} />
|
||||||
|
|
||||||
{/* Facebook Meta Tags */}
|
{/* Facebook Meta Tags */}
|
||||||
<meta property="og:url" content={location.href} />
|
{browser && <meta property="og:url" content={location.href} />}
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:title" content={title} />
|
<meta property="og:title" content={title} />
|
||||||
<meta property="og:description" content={description} />
|
<meta property="og:description" content={description} />
|
||||||
@@ -33,7 +35,7 @@ const Seo = ({
|
|||||||
{/* Twitter Meta Tags */}
|
{/* Twitter Meta Tags */}
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta property="twitter:domain" content="cadhub.xyz" />
|
<meta property="twitter:domain" content="cadhub.xyz" />
|
||||||
<meta property="twitter:url" content={location.href} />
|
{browser && <meta property="twitter:url" content={location.href} />}
|
||||||
<meta name="twitter:title" content={title} />
|
<meta name="twitter:title" content={title} />
|
||||||
<meta name="twitter:description" content={description} />
|
<meta name="twitter:description" content={description} />
|
||||||
<meta name="twitter:image" content={socialImageUrl} />
|
<meta name="twitter:image" content={socialImageUrl} />
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<meta property="og:description" content="A community hub for CodeCAD parts, OpenSCAD, CadQuery and more" />
|
<meta property="og:description" content="A community hub for CodeCAD parts, OpenSCAD, CadQuery and more" />
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta property="twitter:domain" content="cadhub.xyz" />
|
<meta property="twitter:domain" content="cadhub.xyz" />
|
||||||
<meta property="og:locale" content={lang} />
|
<meta property="og:locale" content="en-US" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="redwood-app">
|
<div id="redwood-app">
|
||||||
|
|||||||
Reference in New Issue
Block a user