diff --git a/scripts/check-dist.mjs b/scripts/check-dist.mjs index 4dd7597..bd60f64 100644 --- a/scripts/check-dist.mjs +++ b/scripts/check-dist.mjs @@ -584,6 +584,12 @@ for (const [file, expect] of Object.entries(productPages)) { if (!joined.includes('"hasMerchantReturnPolicy"') || !joined.includes('/refund-policy/')) { throw new Error(`Product JSON-LD on ${file} is missing hasMerchantReturnPolicy pointing at /refund-policy/`); } + if (!joined.includes('https://schema.org/FreeReturn')) { + throw new Error(`Product JSON-LD on ${file} must set returnFees FreeReturn`); + } + if (/ReturnByMail|ReturnAtKiosk/.test(joined)) { + throw new Error(`Product JSON-LD on ${file} must not claim a physical return method`); + } if (!joined.includes('"applicableCountry":"AU"') && !joined.includes('"applicableCountry": "AU"')) { throw new Error(`Product JSON-LD on ${file} must set applicableCountry AU`); } @@ -823,3 +829,15 @@ for (const href of ['/tools/gst-calculator/', '/tools/lead-cost-calculator/', '/ if (/\bToby\b/.test(homeFix14 + logbook)) { throw new Error('fix14 pages must not use Toby’s name'); } + +// --- fix15: contactPoint uses support@; no hello@ (already scanned above); returnFees already checked --- +const homeOrg = read(join(dist, 'index.html')); +if (!homeOrg.includes('"@type":"ContactPoint"') && !homeOrg.includes('"@type": "ContactPoint"')) { + throw new Error('Organization JSON-LD should include a ContactPoint'); +} +if (!homeOrg.includes('support@thedigitalkitbag.com')) { + throw new Error('Homepage should include support@thedigitalkitbag.com'); +} +if (/hello@thedigitalkitbag\.com/i.test(homeOrg)) { + throw new Error('Homepage must not include hello@'); +} diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro index 813a20a..d835678 100644 --- a/src/layouts/Base.astro +++ b/src/layouts/Base.astro @@ -48,7 +48,13 @@ const organization = { name: site.name, url: site.url, logo: `${absoluteUrl('/logo.png')}${v}`, - email: site.email, + email: site.supportEmail, + contactPoint: { + '@type': 'ContactPoint', + contactType: 'customer support', + email: site.supportEmail, + areaServed: 'AU', + }, description: `${site.tagline} Spreadsheet and document tools for Australian sole traders and small crews.`, areaServed: 'AU', }; diff --git a/src/lib/schema.ts b/src/lib/schema.ts index c87da49..80eed81 100644 --- a/src/lib/schema.ts +++ b/src/lib/schema.ts @@ -31,11 +31,14 @@ export function productJsonLd(product: ProductOfferInput) { hasMerchantReturnPolicy: { '@type': 'MerchantReturnPolicy', applicableCountry: 'AU', - // Faulty or not-as-described files are fixed, replaced or refunded, and - // Australian Consumer Law rights always apply. The policy does not state - // a finite return window, and change-of-mind refunds are not the usual case. + // Faulty or not-as-described files are fixed, replaced or refunded by + // email, with no physical return and no return fee. Australian Consumer + // Law rights always apply. The policy does not state a finite window, and + // change-of-mind refunds are not the usual case. returnMethod is omitted + // because nothing is posted back (ReturnByMail / ReturnAtKiosk would be untrue). returnPolicyCategory: 'https://schema.org/MerchantReturnUnlimitedWindow', merchantReturnLink: refundPolicyUrl, + returnFees: 'https://schema.org/FreeReturn', }, shippingDetails: { '@type': 'OfferShippingDetails',