Skip to content

Commit

Permalink
fix(project): fix helmet for legacy series after react update
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLantukh committed Aug 14, 2023
1 parent 6216bd2 commit 90d489c
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions src/pages/LegacySeries/LegacySeries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,33 +146,32 @@ const LegacySeries = () => {
return (
<React.Fragment>
<Helmet>
<>
<title>{pageTitle}</title>
<link rel="canonical" href={canonicalUrl} />
<meta name="description" content={pageDescription} />
<meta property="og:description" content={pageDescription} />
<meta property="og:title" content={pageTitle} />
<meta property="og:type" content={episode ? 'video.episode' : 'video.series'} />
{selectedItemImage && <meta property="og:image" content={selectedItemImage?.replace(/^https:/, 'http:')} />}
{selectedItemImage && <meta property="og:image:secure_url" content={selectedItemImage?.replace(/^http:/, 'https:')} />}
{selectedItemImage && <meta property="og:image:width" content={selectedItemImage ? '720' : ''} />}
{selectedItemImage && <meta property="og:image:height" content={selectedItemImage ? '406' : ''} />}
<meta name="twitter:title" content={pageTitle} />
<meta name="twitter:description" content={pageDescription} />
{selectedItemImage && <meta name="twitter:image" content={selectedItemImage} />}
<meta property="og:video" content={canonicalUrl.replace(/^https:/, 'http:')} />
<meta property="og:video:secure_url" content={canonicalUrl.replace(/^http:/, 'https:')} />
<meta property="og:video:type" content="text/html" />
<meta property="og:video:width" content="1280" />
<meta property="og:video:height" content="720" />
{selectedItem.tags &&
String(selectedItem.tags)
<title>{pageTitle}</title>
<link rel="canonical" href={canonicalUrl} />
<meta name="description" content={pageDescription} />
<meta property="og:description" content={pageDescription} />
<meta property="og:title" content={pageTitle} />
<meta property="og:type" content={episode ? 'video.episode' : 'video.series'} />
{selectedItemImage && <meta property="og:image" content={selectedItemImage?.replace(/^https:/, 'http:')} />}
{selectedItemImage && <meta property="og:image:secure_url" content={selectedItemImage?.replace(/^http:/, 'https:')} />}
{selectedItemImage && <meta property="og:image:width" content={selectedItemImage ? '720' : ''} />}
{selectedItemImage && <meta property="og:image:height" content={selectedItemImage ? '406' : ''} />}
<meta name="twitter:title" content={pageTitle} />
<meta name="twitter:description" content={pageDescription} />
{selectedItemImage && <meta name="twitter:image" content={selectedItemImage} />}
<meta property="og:video" content={canonicalUrl.replace(/^https:/, 'http:')} />
<meta property="og:video:secure_url" content={canonicalUrl.replace(/^http:/, 'https:')} />
<meta property="og:video:type" content="text/html" />
<meta property="og:video:width" content="1280" />
<meta property="og:video:height" content="720" />
{selectedItem.tags
? String(selectedItem.tags)
.split(',')
.map((tag: string) => <meta property="og:video:tag" content={tag} key={tag} />)}
{seriesPlaylist && selectedItem ? (
<script type="application/ld+json">{generateLegacyEpisodeJSONLD(seriesPlaylist, episode, episodeMetadata, seriesId)}</script>
) : null}
</>
.map((tag: string) => <meta property="og:video:tag" content={tag} key={tag} />)
: null}
{seriesPlaylist && selectedItem ? (
<script type="application/ld+json">{generateLegacyEpisodeJSONLD(seriesPlaylist, episode, episodeMetadata, seriesId)}</script>
) : null}
</Helmet>
<VideoLayout
item={episode}
Expand Down

0 comments on commit 90d489c

Please sign in to comment.