mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-06 12:57:44 +00:00
chore: fix SEO tags loading for post pages
This commit is contained in:
@@ -6,10 +6,10 @@ const { keywords, editedTime, publishedTime, unicornsData } = Astro.props as Pro
|
||||
const author = unicornsData.map(uni => uni.name).join(",");
|
||||
---
|
||||
|
||||
<>{keywords.map(keyword =>
|
||||
<meta property="article:tag" content={keyword} />)}
|
||||
<>{keywords?.length ? keywords.map(keyword =>
|
||||
<meta property="article:tag" content={keyword} />) : null}
|
||||
</>
|
||||
<meta property="article:section" content="Technology" />,
|
||||
<meta property="article:section" content="Technology" />
|
||||
<meta property="article:author" content={author}/>
|
||||
<>{editedTime &&
|
||||
<meta property="article:modified_time" content={editedTime} />}
|
||||
|
||||
@@ -19,7 +19,7 @@ const {langData, siteMetadata, pathName} = Astro.props as Props;
|
||||
href-lang="x-default"
|
||||
/>
|
||||
)}
|
||||
{langData?.otherLangs &&
|
||||
{langData?.otherLangs?.length ?
|
||||
langData.otherLangs.map((lang) => (
|
||||
<link
|
||||
rel="alternate"
|
||||
@@ -30,5 +30,5 @@ const {langData, siteMetadata, pathName} = Astro.props as Props;
|
||||
}
|
||||
href-lang={lang}
|
||||
/>
|
||||
))}
|
||||
)) : null}
|
||||
|
||||
@@ -32,13 +32,13 @@ const {
|
||||
langData ? fileToOpenGraphConverter(langData.currentLang) : "en"
|
||||
}
|
||||
/>
|
||||
{langData?.otherLangs &&
|
||||
{langData?.otherLangs?.length ?
|
||||
langData.otherLangs.map((lang) => (
|
||||
<meta
|
||||
property="og:locale:alternate"
|
||||
content={fileToOpenGraphConverter(lang)}
|
||||
/>
|
||||
))}
|
||||
)) : null}
|
||||
<meta property="og:description" content={metaDescription} />
|
||||
<meta property="og:image" content={metaImage} />
|
||||
<meta property="og:type" content={ogType} />
|
||||
@@ -24,6 +24,6 @@ const {
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:site" content={siteMetadata.twitterHandle} />
|
||||
<meta name="twitter:image" content={metaImage} />
|
||||
{type === "article" && unicornsData!.length === 1 && uniTwitter ? (
|
||||
{type === "article" && unicornsData?.length === 1 && uniTwitter ? (
|
||||
<meta property="twitter:creator" content={`@${uniTwitter}`} />
|
||||
) : null}
|
||||
@@ -45,10 +45,11 @@ const otherLangs = translations
|
||||
---
|
||||
|
||||
<Document>
|
||||
<TabsScript/>
|
||||
<TabsScript slot="head"/>
|
||||
<!-- TODO: Add this -->
|
||||
<!-- pathName={router.asPath} -->
|
||||
<SEO
|
||||
slot="head"
|
||||
title={post.title}
|
||||
description={post.description || post.excerpt}
|
||||
unicornsData={post.authors}
|
||||
|
||||
Reference in New Issue
Block a user