diff --git a/components/SEO.js b/components/SEO.js index 6a9252c..a62dd68 100644 --- a/components/SEO.js +++ b/components/SEO.js @@ -2,7 +2,7 @@ import Head from 'next/head' import { useRouter } from 'next/router' import siteMetadata from '@/data/siteMetadata' -export const PageSeo = ({ title, description, taxonomy }) => { +const CommonSEO = ({ title, description, ogType, ogImage, twImage }) => { const router = useRouter() return ( @@ -10,29 +10,64 @@ export const PageSeo = ({ title, description, taxonomy }) => { - + - + {ogImage.constructor.name === 'Array' ? ( + ogImage.map(({ url }) => ) + ) : ( + + )} - - {taxonomy && ( + + + ) +} + +export const PageSEO = ({ title, description }) => { + const ogImageUrl = siteMetadata.siteUrl + siteMetadata.socialBanner + const twImageUrl = siteMetadata.siteUrl + siteMetadata.socialBanner + return ( + + ) +} + +export const TagSEO = ({ title, description }) => { + const ogImageUrl = siteMetadata.siteUrl + siteMetadata.socialBanner + const twImageUrl = siteMetadata.siteUrl + siteMetadata.socialBanner + const router = useRouter() + return ( + <> + + - )} - + + ) } -export const BlogSeo = ({ authorDetails, title, summary, date, lastmod, url, images = [] }) => { +export const BlogSEO = ({ authorDetails, title, summary, date, lastmod, url, images = [] }) => { const router = useRouter() const publishedAt = new Date(date).toISOString() const modifiedAt = new Date(lastmod || date).toISOString() @@ -88,31 +123,26 @@ export const BlogSeo = ({ authorDetails, title, summary, date, lastmod, url, ima description: summary, } + const twImageUrl = featuredImages[0].url + return ( <> + - {title} - - - - - - - - {featuredImages.map((img) => ( - - ))} - - - - - {date && } {lastmod && }