Treat website meta tags as label + full HTML snippets.
Public business-info now exposes metaTags as { html }, matching how admins paste complete <meta> tags in Tags & Badges.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
63ae9b22b9
commit
e0cd2327eb
@@ -336,13 +336,13 @@ These are **required on every crawlable page** (home, listing, product/blog/port
|
||||
Business admins configure this under **Website → Tags & Badges**.
|
||||
|
||||
1. `GET /tenants/{domain}/website/business-info`
|
||||
2. For each item in `metaTags` (array of `{ name, content }`), emit once in the root layout `<head>`:
|
||||
2. For each item in `metaTags` (array of `{ html }`), emit the full HTML once in the root layout `<head>`.
|
||||
|
||||
```html
|
||||
<meta name="{name}" content="{content}">
|
||||
{html}
|
||||
```
|
||||
|
||||
In Next.js App Router, map them into `generateMetadata()` → `other: { [name]: content }`. Verification metas (eNamad, Google, etc.) belong here as custom name/value rows.
|
||||
Example `html` value: `<meta name="google-site-verification" content="…">` (also supports `property`, `http-equiv`, etc.). Parse attributes into a `<meta />` element, or inject the sanitized string into `<head>`. Do **not** wrap it again as `name`/`content` — `html` is already the whole tag. The dashboard “Name” field is an admin label only and is **not** in this public payload.
|
||||
|
||||
3. For each item in `trustBadges` (array of `{ kind, embedHtml }`), render `embedHtml` in the site footer (e.g. `dangerouslySetInnerHTML`). These are HTML widgets only (not meta). Scripts are stripped by the API — still treat the HTML as CMS-controlled content.
|
||||
|
||||
|
||||
@@ -570,14 +570,16 @@
|
||||
},
|
||||
"metaTags": {
|
||||
"type": "array",
|
||||
"description": "Enabled custom meta tags for the site <head> (name/content). Configured under Website → Tags & Badges.",
|
||||
"description": "Custom <meta> HTML snippets for the site <head>. Each item is { html } with a full <meta …> tag. Configured under Website → Tags & Badges (name there is an admin label only).",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
"content": { "type": "string" }
|
||||
"html": {
|
||||
"type": "string",
|
||||
"description": "Full sanitized <meta …> HTML tag to inject in <head>."
|
||||
}
|
||||
},
|
||||
"required": ["name", "content"]
|
||||
"required": ["html"]
|
||||
}
|
||||
},
|
||||
"trustBadges": {
|
||||
|
||||
Reference in New Issue
Block a user