Skip to content

Commit

Permalink
Update SEO.js
Browse files Browse the repository at this point in the history
  • Loading branch information
miltonbolonha authored Jan 19, 2024
1 parent c0e6777 commit bdd2e6a
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions next-boilerplate/src/components/SEO.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,90 +10,90 @@ const Seo = ({ children, data = null }) => {
}
return (
<Head>
<html lang={data.i18n} />
<title>{data.title}</title>
<html lang={data?.i18n} />
<title>{data?.title}</title>
<meta name='robots' content={"index, follow"} />
<meta name='description' content={data.description} />
{data.brandCardImage || data.featuredImage ? (
<meta name='description' content={data?.description} />
{data?.brandCardImage || data?.featuredImage ? (
<meta
name='image'
content={data.brandCardImage || data.featuredImage}
content={data?.brandCardImage || data?.featuredImage}
/>
) : (
""
)}
<meta name='keywords' content={data.keywords.map(e => e)} />
<meta name='keywords' content={data?.keywords?.map(e => e)} />

<meta property='article:author' content={data.siteUrl + "/biografia/"} />
<meta name='author' content={data.author} />
<meta property='article:author' content={data.siteUrl} />
<meta property='article:publisher' content={data.siteUrl} />
<meta property='article:author' content={data?.siteUrl + "/biografia/"} />
<meta name='author' content={data?.author} />
<meta property='article:author' content={data?.siteUrl} />
<meta property='article:publisher' content={data?.siteUrl} />

{/* OpenGraph tags */}
{data.topology === "post" ? (
{data?.topology === "post" ? (
<meta property='og:type' content='article' />
) : (
<meta property='og:type' content='website' />
)}
<meta property='og:url' content={data.articleUrl} />
<meta property='og:site_name' content={data.title} />
<meta property='og:title' content={data.title} />
<meta property='og:description' content={data.description} />
<meta property='og:url' content={data?.articleUrl} />
<meta property='og:site_name' content={data?.title} />
<meta property='og:title' content={data?.title} />
<meta property='og:description' content={data?.description} />
<meta
property='og:image'
content={data.brandCardImage || data.featuredImage}
content={data?.brandCardImage || data?.featuredImage}
/>
<meta name='theme-color' content={data.themeColor || "#FF0081"} />
<link rel='canonical' href={data.siteUrl + "/" + data.slug} />
{data.fbAppID ? (
<meta property='fb:app_id' content={data.social.fbAppID} />
<meta name='theme-color' content={data?.themeColor || "#FF0081"} />
<link rel='canonical' href={data?.siteUrl + "/" + data?.slug} />
{data?.fbAppID ? (
<meta property='fb:app_id' content={data?.social.fbAppID} />
) : null}
{data.twitter ? (
{data?.twitter ? (
<meta name='twitter:card' content='summary_large_image' />
) : (
""
)}
{data.twitter ? (
<meta name='twitter:creator' content={data.twitter} />
{data?.twitter ? (
<meta name='twitter:creator' content={data?.twitter} />
) : null}
{data.twitter ? <meta name='twitter:title' content={data.title} /> : ""}
{data.twitter ? (
<meta name='twitter:description' content={data.description} />
{data?.twitter ? <meta name='twitter:title' content={data?.title} /> : ""}
{data?.twitter ? (
<meta name='twitter:description' content={data?.description} />
) : (
""
)}
{data.twitter ? (
{data?.twitter ? (
<meta
name='twitter:image:src'
content={data.brandCardImage || data.featuredImage}
content={data?.brandCardImage || data?.featuredImage}
/>
) : (
""
)}
{data.twitter ? (
<meta name='twitter:site' content={`@` + data.twitter} />
{data?.twitter ? (
<meta name='twitter:site' content={`@` + data?.twitter} />
) : (
""
)}
{data.datePublished ? (
<meta name='article:published_time' content={data.datePublished} />
{data?.datePublished ? (
<meta name='article:published_time' content={data?.datePublished} />
) : (
""
)}
{/* Schema.org tags */}
{data.topology === "pages" ? (
{data?.topology === "pages" ? (
<script type='application/ld+json' data-schema='Article'>
{JSON.stringify(data.articleSchema)}
{JSON.stringify(data?.articleSchema)}
</script>
) : null}
<script type='application/ld+json' data-schema='WebSite'>
{JSON.stringify(data.webSiteSchema)}
{JSON.stringify(data?.webSiteSchema)}
</script>
<script type='application/ld+json' data-schema='Organization'>
{JSON.stringify(data.orgSchema)}
{JSON.stringify(data?.orgSchema)}
</script>
<script type='application/ld+json'>
{JSON.stringify(data.questionSchema)}
{JSON.stringify(data?.questionSchema)}
</script>
{children}
</Head>
Expand Down

0 comments on commit bdd2e6a

Please sign in to comment.