1.2.0: local SEO structured data (LocalBusiness, Service, FAQPage), noindex per page

This commit is contained in:
2026-09-08 12:49:49 +02:00
parent e39e2a361a
commit 068415849f
34 changed files with 1030 additions and 104 deletions
+48
View File
@@ -0,0 +1,48 @@
type ServiceJsonLdArgs = {
/** Area served, e.g. 'Wrocław' or ['Wrocław', 'Oława']. */
areaServed?: string | string[]
description?: string
/** Service name, e.g. 'Sprzątanie biur'. */
name: string
/** Provider (business) name. */
providerName: string
/** Service type / category. */
serviceType?: string
url: string
}
/**
* Builds Service JSON-LD (schema.org) for a service offering. Helps Google
* understand "what this page sells" — useful for service landing pages
* ("usługa + miasto"). Pairs well with LocalBusiness (the provider).
*
* Per-page (each service page emits its own), data from the panel:
*
* import { buildServiceJsonLd } from '@intecion/ipal-kit'
* const jsonLd = buildServiceJsonLd({
* name: page.serviceName, providerName: company.name,
* url: pageUrl, areaServed: 'Wrocław',
* })
*/
export function buildServiceJsonLd({
name,
areaServed,
description,
providerName,
serviceType,
url,
}: ServiceJsonLdArgs) {
return {
name,
'@context': 'https://schema.org',
'@type': 'Service',
provider: {
name: providerName,
'@type': 'LocalBusiness',
url,
},
...(description ? { description } : {}),
...(areaServed ? { areaServed } : {}),
...(serviceType ? { serviceType } : {}),
}
}