UNPKG

@unhead/schema-org

Version:

Unhead Schema.org for Simple and Automated Google Rich Results

30 lines (27 loc) 723 B
import { d as defineSchemaOrgResolver, ad as resolveWithBase } from '../shared/schema-org.Cp6bpwL2.mjs'; import 'unhead/plugins'; import 'unhead/utils'; import 'ufo'; const searchActionResolver = defineSchemaOrgResolver({ defaults: { "@type": "SearchAction", "target": { "@type": "EntryPoint" }, "query-input": { "@type": "PropertyValueSpecification", "valueRequired": true, "valueName": "search_term_string" } }, resolve(node, ctx) { if (typeof node.target === "string") { node.target = { "@type": "EntryPoint", "urlTemplate": resolveWithBase(ctx.meta.host, node.target) }; } return node; } }); export { searchActionResolver };