Commit dd63a83
feat(commerce/seo): add descriptionSource option to SeoPDPV2
Adds a `descriptionSource` prop ("seo" | "product") that controls which
field is used as the meta description when no manual override is set.
- "seo" (default): uses jsonLD.seo.description — existing behavior, no breaking change
- "product": strips HTML from jsonLD.product.description — useful when
the SEO description is empty or when the richer product copy is preferred
In VTEX, product.description is a rich-text HTML field meant for page
display, while seo.description maps to metaTagDescription — a plain-text
field designed for meta tags. The "product" source strips HTML before
writing to <meta name="description"> and og:description.
Falls back to the other source if the chosen one is empty.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent cc04882 commit dd63a83
1 file changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
| |||
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
| 48 | + | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
46 | 65 | | |
47 | 66 | | |
48 | 67 | | |
49 | 68 | | |
50 | 69 | | |
51 | 70 | | |
52 | | - | |
| 71 | + | |
53 | 72 | | |
54 | 73 | | |
55 | 74 | | |
| |||
0 commit comments