fix: fix OG URLs

This commit is contained in:
Hossein Mehrabi 2023-12-07 03:56:24 +03:30
parent 795ad26e40
commit e4e55deed4
No known key found for this signature in database
GPG Key ID: 45C04964191AFAA1
2 changed files with 3 additions and 13 deletions

View File

@ -1,7 +1,6 @@
import { SEO } from '@/components/SEO'
import ArticleContainer from '@/containers/ArticleContainer'
import { GetStaticPropsContext } from 'next'
import { useRouter } from 'next/router'
import unbodyApi from '../../services/unbody/unbody.service'
import { LPE } from '../../types/lpe.types'
@ -12,10 +11,6 @@ type ArticleProps = {
}
const ArticlePage = ({ data, errors, why }: ArticleProps) => {
const {
query: { slug },
} = useRouter()
if (!data) return null
if (errors) return <div>{errors}</div>
@ -26,7 +21,7 @@ const ArticlePage = ({ data, errors, why }: ArticleProps) => {
description={data.data.summary}
noIndex={data.data.isDraft}
image={data.data.coverImage}
pagePath={`/article/${slug}`}
pagePath={`/article/${data.data.slug}`}
date={data.data.createdAt}
tags={[
...data.data.tags,

View File

@ -1,7 +1,6 @@
import { SEO } from '@/components/SEO'
import EpisodeContainer from '@/containers/EpisodeContainer'
import { GetStaticPropsContext } from 'next'
import { useRouter } from 'next/router'
import { LPE } from '../../../types/lpe.types'
import unbodyApi from '@/services/unbody/unbody.service'
@ -14,10 +13,6 @@ type EpisodeProps = {
}
const EpisodePage = ({ episode, relatedEpisodes, errors }: EpisodeProps) => {
const {
query: { showSlug, epSlug },
} = useRouter()
if (!episode) return null
if (errors) return <div>{errors}</div>
@ -30,8 +25,8 @@ const EpisodePage = ({ episode, relatedEpisodes, errors }: EpisodeProps) => {
image={episode.coverImage}
imageUrl={undefined}
pagePath={getPostLink('podcast', {
showSlug: showSlug as string,
postSlug: epSlug as string,
showSlug: episode.show?.slug as string,
postSlug: episode.slug as string,
})}
tags={[
...episode.tags,