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 { renderRichText } from '@/lib/render-rich-text'
|
||||
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 { ProductContentTabs } from './product-content-tabs'
|
||||
import { ProductGallerySection } from './product-gallery-section'
|
||||
@@ -715,21 +715,11 @@ export default async function ProductDetailPage({
|
||||
const productSeriesName = getProductSeriesName(cmsProduct, slug, locale)
|
||||
const productBreadcrumbLabel = [productSeriesName, productName].filter(Boolean).join(' - ')
|
||||
const productTagline = getLocalizedValue(product.tagline, locale)
|
||||
const showProductTagline = Boolean(cmsProduct?.display?.showTaglinePublic)
|
||||
const downloadPageHref =
|
||||
cmsProduct?.firmware?.showOnProductPage && downloads.length > 0 ? `/${locale}/downloads/${slug}` : null
|
||||
|
||||
const templateId = product.template
|
||||
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(
|
||||
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 } =>
|
||||
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}`)
|
||||
|
||||
return (
|
||||
@@ -803,25 +788,6 @@ export default async function ProductDetailPage({
|
||||
}
|
||||
>
|
||||
<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
|
||||
type="application/ld+json"
|
||||
suppressHydrationWarning
|
||||
@@ -856,18 +822,6 @@ export default async function ProductDetailPage({
|
||||
<div className="max-w-[1100px]">
|
||||
<div className="max-w-reading min-w-0">
|
||||
<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 ? (
|
||||
<div className="mt-5">
|
||||
<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)
|
||||
|
||||
return {
|
||||
host: siteUrl,
|
||||
rules: isProduction
|
||||
? [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user