From 3f01721a990e70c033c347d3535ac7f738a48521 Mon Sep 17 00:00:00 2001 From: AdrianoDev Date: Sun, 5 Jul 2026 16:04:27 +0200 Subject: [PATCH] feat: tag contenuti home hero, info, feature, quote --- src/components/home/FeatureBlocks.astro | 21 +++++++------ src/components/home/HeroSlider.astro | 12 ++++---- src/components/home/InfoColumns.astro | 14 +++++---- src/components/home/QuoteBanner.astro | 13 ++++----- src/data/content-seed.ts | 39 +++++++++++++++++++++++++ src/pages/index.astro | 8 +++-- 6 files changed, 75 insertions(+), 32 deletions(-) diff --git a/src/components/home/FeatureBlocks.astro b/src/components/home/FeatureBlocks.astro index f35f301..9a7ae01 100644 --- a/src/components/home/FeatureBlocks.astro +++ b/src/components/home/FeatureBlocks.astro @@ -1,26 +1,25 @@ --- -import { Image } from 'astro:assets'; import featPerformance from '../../assets/img/feature-performance.jpg'; import featBalance from '../../assets/img/feature-balance.jpg'; import featLongevity from '../../assets/img/feature-longevity.jpg'; +import T from '../content/T.astro'; +import TImg from '../content/TImg.astro'; +import { t } from '../../lib/content'; const blocks = [ - { title: 'PERFORMANCE', image: featPerformance, reverse: false, - text: 'Allenamenti progettati su misura per adattarsi ai tuoi obiettivi e al tuo livello. Programmi mirati che sviluppano forza, resistenza e funzionalità in modo equilibrato. Un metodo efficace per migliorare le performance e ottenere risultati concreti e duraturi.' }, - { title: 'BALANCE', image: featBalance, reverse: true, - text: 'L’equilibrio tra corpo e mente è la base di ogni performance duratura. Attraverso movimento, recupero e gestione dello stress, costruiamo stabilità e controllo. Un approccio integrato che sostiene benessere, energia e continuità nel tempo.' }, - { title: 'LONGEVITY', image: featLongevity, reverse: false, - text: 'Benessere completo tra movimento, nutrizione e stile di vita. Un percorso personalizzato che unisce prevenzione, recupero ed equilibrio. Investi nella tua salute e qualità della vita nel tempo.' }, + { key: 'performance', image: featPerformance, reverse: false }, + { key: 'balance', image: featBalance, reverse: true }, + { key: 'longevity', image: featLongevity, reverse: false }, ]; ---
{blocks.map((b) => (
- {b.title} +
-

{b.title}

-

{b.text}

- Scopri + + + {t(`home.feature.${b.key}.cta`)}
))} diff --git a/src/components/home/HeroSlider.astro b/src/components/home/HeroSlider.astro index b5239c1..7ce3273 100644 --- a/src/components/home/HeroSlider.astro +++ b/src/components/home/HeroSlider.astro @@ -1,8 +1,10 @@ --- -import { Image } from 'astro:assets'; import hero1 from '../../assets/img/hero-1.png'; +import T from '../content/T.astro'; +import TImg from '../content/TImg.astro'; +import { t } from '../../lib/content'; const slides = [ - { title: ['PERFORMANCE.', 'BALANCE.', 'LONGEVITY.'], image: hero1, alt: 'Atleti InsanityLab' }, + { titleTags: ['home.hero.title-line-1', 'home.hero.title-line-2', 'home.hero.title-line-3'], image: hero1, alt: 'Atleti InsanityLab' }, ]; ---
@@ -10,10 +12,10 @@ const slides = [
-

{s.title.map((line) => {line})}

- Scopri +

{s.titleTags.map((tag) => )}

+ {t('home.hero.cta')}
- {s.alt} +
))} diff --git a/src/components/home/InfoColumns.astro b/src/components/home/InfoColumns.astro index 3adba4d..a91f7af 100644 --- a/src/components/home/InfoColumns.astro +++ b/src/components/home/InfoColumns.astro @@ -3,18 +3,20 @@ import { getImage } from 'astro:assets'; import infoPerformance from '../../assets/img/info-performance.jpg'; import infoBalance from '../../assets/img/info-balance.jpg'; import infoLongevity from '../../assets/img/info-longevity.jpg'; +import T from '../content/T.astro'; +import { contentImageUrl } from '../../lib/content'; // getImage garantisce l'emissione dell'asset anche quando il file è byte-identico // ad altri import (Astro dedupa e non emette l'originale usato solo come background). const cols = await Promise.all([ - { title: 'PERFORMANCE.', image: infoPerformance }, - { title: 'BALANCE.', image: infoBalance }, - { title: 'LONGEVITY.', image: infoLongevity }, -].map(async (c) => ({ ...c, bg: (await getImage({ src: c.image, width: 1200 })).src }))); + { titleTag: 'home.info.col1.title', imageTag: 'home.info.col1.image', image: infoPerformance }, + { titleTag: 'home.info.col2.title', imageTag: 'home.info.col2.image', image: infoBalance }, + { titleTag: 'home.info.col3.title', imageTag: 'home.info.col3.image', image: infoLongevity }, +].map(async (c) => ({ ...c, bg: contentImageUrl(c.imageTag, (await getImage({ src: c.image, width: 1200 })).src) }))); ---
{cols.map((c, i) => ( - - {c.title} + + ))}
diff --git a/src/components/home/QuoteBanner.astro b/src/components/home/QuoteBanner.astro index 8ffaeeb..26247e7 100644 --- a/src/components/home/QuoteBanner.astro +++ b/src/components/home/QuoteBanner.astro @@ -1,22 +1,21 @@ --- import { getImage } from 'astro:assets'; import quoteBgSrc from '../../assets/img/quote-bg.jpg'; -const quoteBg = await getImage({ src: quoteBgSrc, width: 1920 }); -const quote = 'PERFORMANCE È SPINGERE OLTRE I PROPRI LIMITI, BALANCE È SAPERLI ASCOLTARE, LONGEVITY È COSTRUIRE NEL TEMPO CIÒ CHE DAVVERO CONTA.'; -const quoteHtml = quote.replace(/(PERFORMANCE|BALANCE|LONGEVITY)/g, '$1'); +import { t, contentImageUrl } from '../../lib/content'; +const quoteBg = contentImageUrl('home.quote.image', (await getImage({ src: quoteBgSrc, width: 1920 })).src); ---
-
+

- -

- Insanitylab + {t('home.quote.cite')}
diff --git a/src/data/content-seed.ts b/src/data/content-seed.ts index 93deb38..dfecec8 100644 --- a/src/data/content-seed.ts +++ b/src/data/content-seed.ts @@ -58,6 +58,45 @@ export const contentSeed: SeedEntry[] = [ T('form.msg.success', 'Messaggio inviato, ti ricontatteremo al più presto.', []), T('form.msg.error-generic', 'Errore di invio, riprova più tardi.', []), T('form.msg.error-network', 'Errore di rete, riprova più tardi.', []), + + // --- Home: meta, training heading --- + T('home.meta.title', 'Performance. Balance. Longevity.', []), + T('home.training.title', 'Training'), + T('home.training.subtitle', 'Porta i tuoi allenamenti al livello successivo: trova il percorso più adatto alle tue esigenze.'), + + // --- Home: hero --- + T('home.hero.title-line-1', 'PERFORMANCE.'), + T('home.hero.title-line-2', 'BALANCE.'), + T('home.hero.title-line-3', 'LONGEVITY.'), + T('home.hero.cta', 'Scopri'), + I('home.hero.image'), + + // --- Home: info columns --- + T('home.info.col1.title', 'PERFORMANCE.'), + T('home.info.col2.title', 'BALANCE.'), + T('home.info.col3.title', 'LONGEVITY.'), + I('home.info.col1.image'), + I('home.info.col2.image'), + I('home.info.col3.image'), + + // --- Home: feature blocks --- + T('home.feature.performance.title', 'PERFORMANCE'), + T('home.feature.performance.body', 'Allenamenti progettati su misura per adattarsi ai tuoi obiettivi e al tuo livello. Programmi mirati che sviluppano forza, resistenza e funzionalità in modo equilibrato. Un metodo efficace per migliorare le performance e ottenere risultati concreti e duraturi.'), + T('home.feature.performance.cta', 'Scopri'), + T('home.feature.balance.title', 'BALANCE'), + T('home.feature.balance.body', 'L’equilibrio tra corpo e mente è la base di ogni performance duratura. Attraverso movimento, recupero e gestione dello stress, costruiamo stabilità e controllo. Un approccio integrato che sostiene benessere, energia e continuità nel tempo.'), + T('home.feature.balance.cta', 'Scopri'), + T('home.feature.longevity.title', 'LONGEVITY'), + T('home.feature.longevity.body', 'Benessere completo tra movimento, nutrizione e stile di vita. Un percorso personalizzato che unisce prevenzione, recupero ed equilibrio. Investi nella tua salute e qualità della vita nel tempo.'), + T('home.feature.longevity.cta', 'Scopri'), + I('home.feature.performance.image'), + I('home.feature.balance.image'), + I('home.feature.longevity.image'), + + // --- Home: quote banner --- + H('home.quote.text', 'PERFORMANCE È SPINGERE OLTRE I PROPRI LIMITI, BALANCE È SAPERLI ASCOLTARE, LONGEVITY È COSTRUIRE NEL TEMPO CIÒ CHE DAVVERO CONTA.'), + T('home.quote.cite', 'Insanitylab', []), + I('home.quote.image'), // I task di estrazione aggiungono qui le entry di header/footer/pagine/data file. ]; diff --git a/src/pages/index.astro b/src/pages/index.astro index 665a928..a99d529 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -10,17 +10,19 @@ import Agenda from '../components/Agenda.astro'; import TeamSection from '../components/home/TeamSection.astro'; import MethodSteps from '../components/home/MethodSteps.astro'; import PartnersStrip from '../components/home/PartnersStrip.astro'; +import T from '../components/content/T.astro'; +import { t } from '../lib/content'; export const prerender = true; --- - +
-

Training

-

Porta i tuoi allenamenti al livello successivo: trova il percorso più adatto alle tue esigenze.

+ +