diff --git a/src/data/consulenza.ts b/src/data/consulenza.ts new file mode 100644 index 0000000..4906fe4 --- /dev/null +++ b/src/data/consulenza.ts @@ -0,0 +1,15 @@ +// Consulenza conoscitiva gratuita con Nicola (prenotazione su Google Calendar). +// +// Il link vive nel pannello contenuti (tag `global.consulenza.url`): qui c'è il valore di +// partenza e la guardia. Il tag è modificabile da admin, quindi si accetta solo https. +export const CONSULENZA_URL_DEFAULT = 'https://calendar.app.google/nWXMGD2S5g2pVeeD7'; + +/** Slug delle pagine servizio che mostrano il bottone di prenotazione. */ +export const PAGINE_CON_CONSULENZA = ['reformer-class']; + +/** Link da usare: il valore del pannello se è https, altrimenti quello di default + * (niente javascript:, http:, vuoto). */ +export function linkConsulenza(valore: string): string { + const v = (valore ?? '').trim(); + return v.startsWith('https://') ? v : CONSULENZA_URL_DEFAULT; +} diff --git a/src/data/content-seed.ts b/src/data/content-seed.ts index 32a6bfc..4e2d591 100644 --- a/src/data/content-seed.ts +++ b/src/data/content-seed.ts @@ -7,6 +7,7 @@ import { partners } from './partners'; import { disciplines, days, slots } from './agenda'; import { services } from './services'; import { performanceClassPricing } from './pricing'; +import { CONSULENZA_URL_DEFAULT } from './consulenza'; export type ContentType = 'text' | 'html' | 'image'; export interface SeedEntry { tag: string; type: ContentType; value: string; styleOptions?: StyleGroup[] } @@ -270,6 +271,9 @@ export const contentSeed: SeedEntry[] = [ T('service.pricing.entries-plural', 'ingressi settimanali', []), T('service.pricing.buy-cta', 'Acquista', []), T('service.contact-cta', 'Contattaci', []), + T('service.consulenza-cta', 'Prenota una consulenza conoscitiva gratuita', []), + T('service.consulenza-note', '30-45 minuti con Nicola', []), + T('global.consulenza.url', CONSULENZA_URL_DEFAULT, []), // --- Pricing performance class (data-driven da pricing.ts; monthly/entries restano nel data file) --- T('pricing.heading', performanceClassPricing.heading), diff --git a/src/pages/services/[slug].astro b/src/pages/services/[slug].astro index e28268c..dad1042 100644 --- a/src/pages/services/[slug].astro +++ b/src/pages/services/[slug].astro @@ -10,6 +10,7 @@ import TImg from '../../components/content/TImg.astro'; import CalendarioModal from '../../components/CalendarioModal.astro'; import { calendariDaMostrare, PAGINE_CON_CALENDARIO } from '../../data/calendari'; import { t } from '../../lib/content'; +import { PAGINE_CON_CONSULENZA, linkConsulenza } from '../../data/consulenza'; export const prerender = false; const service = getService(Astro.params.slug!); @@ -38,8 +39,16 @@ const tones = ['tan', 'taupe', 'dark'];

{t(`service.${slug}.title`).toUpperCase()}

- {slug === 'reformer-class' && ( -

{t('service.contact-cta')}

+ {(slug === 'reformer-class' || PAGINE_CON_CONSULENZA.includes(slug)) && ( +
+
+ {slug === 'reformer-class' && {t('service.contact-cta')}} + {PAGINE_CON_CONSULENZA.includes(slug) && ( + {t('service.consulenza-cta')} + )} +
+ {PAGINE_CON_CONSULENZA.includes(slug) && } +
)} {service.features.length > 0 && (