fix: remove product rich result markup
This commit is contained in:
@@ -14,7 +14,7 @@ import { loadProductTemplateHtml } from '@/lib/product-templates'
|
|||||||
import type { LoadedProductTemplate } from '@/lib/product-templates'
|
import type { LoadedProductTemplate } from '@/lib/product-templates'
|
||||||
import { renderRichText } from '@/lib/render-rich-text'
|
import { renderRichText } from '@/lib/render-rich-text'
|
||||||
import { buildAbsoluteUrl, extractRichTextPlainText, trimDescription } from '@/lib/seo'
|
import { buildAbsoluteUrl, extractRichTextPlainText, trimDescription } from '@/lib/seo'
|
||||||
import { buildSeoMetadata, resolveSeoH1, resolveSeoIntro } from '@/lib/seo-metadata'
|
import { buildSeoMetadata } from '@/lib/seo-metadata'
|
||||||
import { normalizeUploadUrl } from '@/lib/upload-url'
|
import { normalizeUploadUrl } from '@/lib/upload-url'
|
||||||
import { ProductContentTabs } from './product-content-tabs'
|
import { ProductContentTabs } from './product-content-tabs'
|
||||||
import { ProductGallerySection } from './product-gallery-section'
|
import { ProductGallerySection } from './product-gallery-section'
|
||||||
@@ -715,21 +715,11 @@ export default async function ProductDetailPage({
|
|||||||
const productSeriesName = getProductSeriesName(cmsProduct, slug, locale)
|
const productSeriesName = getProductSeriesName(cmsProduct, slug, locale)
|
||||||
const productBreadcrumbLabel = [productSeriesName, productName].filter(Boolean).join(' - ')
|
const productBreadcrumbLabel = [productSeriesName, productName].filter(Boolean).join(' - ')
|
||||||
const productTagline = getLocalizedValue(product.tagline, locale)
|
const productTagline = getLocalizedValue(product.tagline, locale)
|
||||||
const showProductTagline = Boolean(cmsProduct?.display?.showTaglinePublic)
|
|
||||||
const downloadPageHref =
|
const downloadPageHref =
|
||||||
cmsProduct?.firmware?.showOnProductPage && downloads.length > 0 ? `/${locale}/downloads/${slug}` : null
|
cmsProduct?.firmware?.showOnProductPage && downloads.length > 0 ? `/${locale}/downloads/${slug}` : null
|
||||||
|
|
||||||
const templateId = product.template
|
const templateId = product.template
|
||||||
const overview = cmsProduct?.overview || cmsProduct?.summary || null
|
const overview = cmsProduct?.overview || cmsProduct?.summary || null
|
||||||
const autoProductH1 = [productName, productSeriesName]
|
|
||||||
.filter(Boolean)
|
|
||||||
.filter((item, index, items) => index === 0 || !items[0]?.toLowerCase().includes(item.toLowerCase()))
|
|
||||||
.join(' ')
|
|
||||||
const productSeoH1 = resolveSeoH1(cmsProduct.seo, autoProductH1 || productName)
|
|
||||||
const productSeoIntro = resolveSeoIntro(
|
|
||||||
cmsProduct.seo,
|
|
||||||
productTagline || trimDescription(extractRichTextPlainText(overview), 260),
|
|
||||||
)
|
|
||||||
const overviewUploadMedia: Record<number, Media> = Object.fromEntries(
|
const overviewUploadMedia: Record<number, Media> = Object.fromEntries(
|
||||||
overviewMedia.map((media) => [media.id, media]),
|
overviewMedia.map((media) => [media.id, media]),
|
||||||
)
|
)
|
||||||
@@ -787,11 +777,6 @@ export default async function ProductDetailPage({
|
|||||||
): award is { id: string; label: string | null; logoUrl: string | null; url: string | null; year: number | null } =>
|
): award is { id: string; label: string | null; logoUrl: string | null; url: string | null; year: number | null } =>
|
||||||
Boolean(award),
|
Boolean(award),
|
||||||
)
|
)
|
||||||
const structuredDescription =
|
|
||||||
trimDescription(extractRichTextPlainText(cmsProduct?.overview || cmsProduct?.summary)) ||
|
|
||||||
trimDescription(productTagline) ||
|
|
||||||
undefined
|
|
||||||
const structuredImage = getMediaUrl(cmsProduct?.heroImage || cmsProduct?.cardImage, 'hero')
|
|
||||||
const productUrl = buildAbsoluteUrl(`/${locale}/products/${slug}`)
|
const productUrl = buildAbsoluteUrl(`/${locale}/products/${slug}`)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -803,25 +788,6 @@ export default async function ProductDetailPage({
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className="mx-auto max-w-page">
|
<div className="mx-auto max-w-page">
|
||||||
<script
|
|
||||||
type="application/ld+json"
|
|
||||||
suppressHydrationWarning
|
|
||||||
dangerouslySetInnerHTML={{
|
|
||||||
__html: JSON.stringify({
|
|
||||||
'@context': 'https://schema.org',
|
|
||||||
'@type': 'Product',
|
|
||||||
brand: {
|
|
||||||
'@type': 'Brand',
|
|
||||||
name: 'Eversolo',
|
|
||||||
},
|
|
||||||
description: structuredDescription,
|
|
||||||
image: structuredImage ? [structuredImage] : undefined,
|
|
||||||
name: productName,
|
|
||||||
sku: productModel || undefined,
|
|
||||||
url: productUrl,
|
|
||||||
}),
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<script
|
<script
|
||||||
type="application/ld+json"
|
type="application/ld+json"
|
||||||
suppressHydrationWarning
|
suppressHydrationWarning
|
||||||
@@ -856,18 +822,6 @@ export default async function ProductDetailPage({
|
|||||||
<div className="max-w-[1100px]">
|
<div className="max-w-[1100px]">
|
||||||
<div className="max-w-reading min-w-0">
|
<div className="max-w-reading min-w-0">
|
||||||
<div className="text-sm text-text-muted">{productBreadcrumbLabel}</div>
|
<div className="text-sm text-text-muted">{productBreadcrumbLabel}</div>
|
||||||
{productSeoH1 ? (
|
|
||||||
<h1 className="mt-4 break-words text-4xl font-medium tracking-tight text-text-primary md:text-6xl">
|
|
||||||
{productSeoH1}
|
|
||||||
</h1>
|
|
||||||
) : null}
|
|
||||||
{productSeoIntro ? (
|
|
||||||
<p className="mt-4 max-w-[760px] text-base leading-8 text-text-secondary md:text-lg">
|
|
||||||
{productSeoIntro}
|
|
||||||
</p>
|
|
||||||
) : showProductTagline && productTagline ? (
|
|
||||||
<p className="mt-4 text-lg text-text-secondary">{productTagline}</p>
|
|
||||||
) : null}
|
|
||||||
{awards.length > 0 ? (
|
{awards.length > 0 ? (
|
||||||
<div className="mt-5">
|
<div className="mt-5">
|
||||||
<div className="flex flex-wrap items-start gap-x-5 gap-y-3">
|
<div className="flex flex-wrap items-start gap-x-5 gap-y-3">
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ export default function robots(): MetadataRoute.Robots {
|
|||||||
const isProduction = isPublicEversoloHost(siteUrl)
|
const isProduction = isPublicEversoloHost(siteUrl)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
host: siteUrl,
|
|
||||||
rules: isProduction
|
rules: isProduction
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user