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(",");
|
const author = unicornsData.map(uni => uni.name).join(",");
|
||||||
---
|
---
|
||||||
|
|
||||||
<>{keywords.map(keyword =>
|
<>{keywords?.length ? keywords.map(keyword =>
|
||||||
<meta property="article:tag" content={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}/>
|
<meta property="article:author" content={author}/>
|
||||||
<>{editedTime &&
|
<>{editedTime &&
|
||||||
<meta property="article:modified_time" content={editedTime} />}
|
<meta property="article:modified_time" content={editedTime} />}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const {langData, siteMetadata, pathName} = Astro.props as Props;
|
|||||||
href-lang="x-default"
|
href-lang="x-default"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{langData?.otherLangs &&
|
{langData?.otherLangs?.length ?
|
||||||
langData.otherLangs.map((lang) => (
|
langData.otherLangs.map((lang) => (
|
||||||
<link
|
<link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
@@ -30,5 +30,5 @@ const {langData, siteMetadata, pathName} = Astro.props as Props;
|
|||||||
}
|
}
|
||||||
href-lang={lang}
|
href-lang={lang}
|
||||||
/>
|
/>
|
||||||
))}
|
)) : null}
|
||||||
|
|
||||||
@@ -32,13 +32,13 @@ const {
|
|||||||
langData ? fileToOpenGraphConverter(langData.currentLang) : "en"
|
langData ? fileToOpenGraphConverter(langData.currentLang) : "en"
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{langData?.otherLangs &&
|
{langData?.otherLangs?.length ?
|
||||||
langData.otherLangs.map((lang) => (
|
langData.otherLangs.map((lang) => (
|
||||||
<meta
|
<meta
|
||||||
property="og:locale:alternate"
|
property="og:locale:alternate"
|
||||||
content={fileToOpenGraphConverter(lang)}
|
content={fileToOpenGraphConverter(lang)}
|
||||||
/>
|
/>
|
||||||
))}
|
)) : null}
|
||||||
<meta property="og:description" content={metaDescription} />
|
<meta property="og:description" content={metaDescription} />
|
||||||
<meta property="og:image" content={metaImage} />
|
<meta property="og:image" content={metaImage} />
|
||||||
<meta property="og:type" content={ogType} />
|
<meta property="og:type" content={ogType} />
|
||||||
@@ -24,6 +24,6 @@ const {
|
|||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta name="twitter:site" content={siteMetadata.twitterHandle} />
|
<meta name="twitter:site" content={siteMetadata.twitterHandle} />
|
||||||
<meta name="twitter:image" content={metaImage} />
|
<meta name="twitter:image" content={metaImage} />
|
||||||
{type === "article" && unicornsData!.length === 1 && uniTwitter ? (
|
{type === "article" && unicornsData?.length === 1 && uniTwitter ? (
|
||||||
<meta property="twitter:creator" content={`@${uniTwitter}`} />
|
<meta property="twitter:creator" content={`@${uniTwitter}`} />
|
||||||
) : null}
|
) : null}
|
||||||
@@ -45,10 +45,11 @@ const otherLangs = translations
|
|||||||
---
|
---
|
||||||
|
|
||||||
<Document>
|
<Document>
|
||||||
<TabsScript/>
|
<TabsScript slot="head"/>
|
||||||
<!-- TODO: Add this -->
|
<!-- TODO: Add this -->
|
||||||
<!-- pathName={router.asPath} -->
|
<!-- pathName={router.asPath} -->
|
||||||
<SEO
|
<SEO
|
||||||
|
slot="head"
|
||||||
title={post.title}
|
title={post.title}
|
||||||
description={post.description || post.excerpt}
|
description={post.description || post.excerpt}
|
||||||
unicornsData={post.authors}
|
unicornsData={post.authors}
|
||||||
|
|||||||
Reference in New Issue
Block a user