cleanup and cms migration
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -1,30 +1,118 @@
|
||||
---
|
||||
import Hero from '../components/Hero.astro';
|
||||
import ServicesPreview from '../components/ServicesPreview.astro';
|
||||
import WhyUs from '../components/WhyUs.astro';
|
||||
import CTABanner from '../components/CTABanner.astro';
|
||||
import { getLangFromUrl, t } from '../i18n/utils';
|
||||
import { getCollection } from 'astro:content';
|
||||
import { getLocale } from '@/lib/locale';
|
||||
import general from '../content/settings/general.json';
|
||||
import BaseLayout from '@/layouts/BaseLayout.astro';
|
||||
import Header from '../components/Header.astro';
|
||||
import Testimonials from '../components/ui/testimonials/Grid';
|
||||
import Footer from '../components/Footer.astro';
|
||||
const lang = getLangFromUrl(Astro.url);
|
||||
import seo from '../content/settings/seo.json';
|
||||
import Layout from '@/layouts/base.astro';
|
||||
import Hero from '@/components/ui/hero';
|
||||
import Services from '@/components/ui/services';
|
||||
import WhyChooseUs from '@/components/ui/why-choose-us';
|
||||
import CTABanner from '@/components/ui/cta-banner';
|
||||
import Footer from '@/components/footer.astro';
|
||||
import Testimonials from '@/components/ui/testimonials';
|
||||
|
||||
const locale = getLocale(Astro);
|
||||
|
||||
const [heroEntry] = await getCollection('hero', (e) => e.id === `${locale}/main`);
|
||||
const [navEntry] = await getCollection('navigation', (e) => e.id === `${locale}/main`);
|
||||
const [ctaEntry] = await getCollection('cta', (e) => e.id === `${locale}/main`);
|
||||
const [pourquoiEntry] = await getCollection('pourquoi', (e) => e.id === `${locale}/main`);
|
||||
|
||||
if (!heroEntry || !navEntry || !ctaEntry || !pourquoiEntry) {
|
||||
throw new Error(`Missing content collections for locale: ${locale}`);
|
||||
}
|
||||
|
||||
const heroData = heroEntry.data;
|
||||
const nav = navEntry.data;
|
||||
const ctaData = ctaEntry.data;
|
||||
const pourquoiData = pourquoiEntry.data;
|
||||
|
||||
const ctaImage = (await import('@/assets/Website Content/Photos/cozy-modern-kitchen-room-interior-design-with-dark-2024-04-01-23-13-59-utc.webp')).default;
|
||||
|
||||
const allServices = await getCollection('services', (s) => s.id.startsWith(`${locale}/`));
|
||||
const services = allServices.sort((a, b) => a.data.order - b.data.order);
|
||||
|
||||
const serviceImages: Record<string, { src: import('astro').ImageMetadata; alt: string }> = {
|
||||
interior: {
|
||||
src: (await import('@/assets/photos/empty-room-blue-wall-with-moulding-and-parquet-fl-2023-11-27-04-52-31-utc.webp')).default,
|
||||
alt: 'Salon avec peinture intérieure soignée',
|
||||
},
|
||||
exterior: {
|
||||
src: (await import('@/assets/Website Content/Photos/wooden-deck-with-sky-2023-11-27-05-29-44-utc.webp')).default,
|
||||
alt: 'Maison avec peinture extérieure',
|
||||
},
|
||||
commercial: {
|
||||
src: (await import('@/assets/Website Content/Photos/minimalist-bright-office-room-interior-design-mee-2023-11-27-05-17-04-utc.webp')).default,
|
||||
alt: 'Espace commercial peint',
|
||||
},
|
||||
decoration: {
|
||||
src: (await import('@/assets/Website Content/Photos/Mural_Jerkspot_02.jpg')).default,
|
||||
alt: 'Décoration intérieure et murale',
|
||||
},
|
||||
renovation: {
|
||||
src: (await import('@/assets/Website Content/Photos/amazing-design-of-a-room-with-doors-and-parquet-fl-2023-11-27-05-33-04-utc.webp')).default,
|
||||
alt: 'Rénovation et finitions',
|
||||
},
|
||||
};
|
||||
|
||||
const features = services.map((service) => {
|
||||
const icon = service.data.icon ?? 'interior';
|
||||
const img = serviceImages[icon] ?? serviceImages.interior;
|
||||
const imageSrc = (img.src as import('astro').ImageMetadata).src;
|
||||
return {
|
||||
name: service.data.title,
|
||||
description: service.data.description,
|
||||
imageSrc,
|
||||
imageAlt: img.alt,
|
||||
};
|
||||
});
|
||||
|
||||
const heroContent = {
|
||||
pillCta: heroData.pillCta,
|
||||
title: heroData.title,
|
||||
subtitle: heroData.subtitle,
|
||||
cta: heroData.cta,
|
||||
ctaHref: heroData.ctaHref,
|
||||
};
|
||||
---
|
||||
|
||||
<BaseLayout
|
||||
title="Peintres Décorateurs | Laval & Rive-Nord"
|
||||
<Layout
|
||||
title={seo.defaultTitle}
|
||||
description={`${general.siteName} — Peintres décorateurs professionnels à Laval et sur la Rive-Nord. Peinture résidentielle et commerciale, décoration intérieure et extérieure. Soumission gratuite.`}
|
||||
canonical="/"
|
||||
>
|
||||
<Header />
|
||||
<Hero />
|
||||
<ServicesPreview />
|
||||
<WhyUs />
|
||||
<Hero client:load content={heroContent} />
|
||||
<Services
|
||||
client:load
|
||||
features={features}
|
||||
title={nav.servicesSection.title}
|
||||
subtitle={nav.servicesSection.subtitle}
|
||||
/>
|
||||
<Testimonials client:load />
|
||||
<CTABanner />
|
||||
|
||||
<WhyChooseUs
|
||||
client:load
|
||||
title={pourquoiData.title}
|
||||
subtitle={pourquoiData.subtitle}
|
||||
cards={pourquoiData.cards}
|
||||
images={{
|
||||
main: (await import('@/assets/Website Content/Photos/silver-and-white-apartment-interior-2023-11-27-05-32-03-utc.webp')).default.src,
|
||||
mainAlt: 'Peintres décorateurs au travail',
|
||||
detail2: (await import('@/assets/Website Content/Photos/choosing-wall-paints-2023-11-27-05-09-01-utc.webp')).default.src,
|
||||
detail2Alt: 'Peintres décorateurs au travail',
|
||||
detail1: (await import('@/assets/Website Content/Photos/choosing-wall-paints-2023-11-27-04-59-54-utc.webp')).default.src,
|
||||
detail1Alt: 'Peintres décorateurs au travail',
|
||||
}}
|
||||
/>
|
||||
<CTABanner
|
||||
client:load
|
||||
title={ctaData.title}
|
||||
subtitle={ctaData.subtitle}
|
||||
buttonText={ctaData.button}
|
||||
buttonHref={ctaData.buttonHref}
|
||||
imageSrc={ctaImage.src}
|
||||
imageAlt={ctaData.imageAlt}
|
||||
/>
|
||||
|
||||
<Footer />
|
||||
|
||||
</BaseLayout>
|
||||
|
||||
</Layout>
|
||||
|
||||
Reference in New Issue
Block a user