Quick Answer: Schema.org params configure site-wide defaults like host, path, currency, and inLanguage. Set them once and they're automatically applied to all schema nodes.
Params let you configure multiple Schema.org nodes at once, reducing boilerplate. Use the schemaOrg option on templateParams.
import { useHead } from '@unhead/solid-js'
useHead({
templateParams: {
schemaOrg: {
host: 'https://example.com',
path: '/blog'
}
}
})
tagPositionstringbodyClosehoststringpathstringwindow.location.pathnameinLanguagestringenisLanguage to this value for any Schema which uses it. Should be a valid language code, i.e en-AUtrailingSlashbooleanfalsecurrencystringundefinedUSD, EUR, GBP.When you set a param like host or inLanguage, it automatically applies to all Schema.org nodes that support that property. This means you define your site defaults once and every defineWebPage, defineArticle, defineProduct, etc. inherits them without repetition.
useHead({
templateParams: {
schemaOrg: {
host: 'https://example.com',
inLanguage: 'en-AU',
currency: 'AUD'
}
}
})
// All schema nodes now use these defaults automatically
useSchemaOrg([
defineWebPage(), // inherits host, inLanguage
defineProduct({ name: 'Widget', offers: { price: 99 } }) // inherits currency
])