Files
obc-terrassement/app/services/page.tsx
Claude 15c60a274c feat: préparation Payload CMS — couche d'abstraction contenu
Sépare données et affichage pour basculer vers Payload CMS sans réécrire les composants.

Nouveaux fichiers :
- lib/site-config.ts : source unique de vérité pour toutes les données du site (as const)
- lib/content.ts : couche async entre données et composants (static aujourd'hui, Payload demain)
- types/content.ts : types TypeScript partagés (Service, Realisation, Partner, BlogPost, etc.)
- payload/ : schémas CollectionConfig et GlobalConfig commentés prêts à activer

Données enrichies dans siteConfig :
- partners : ajout du champ desc pour chaque partenaire
- realisations : 6 entrées complètes avec categorie et color
- blogPosts : 6 articles avec slug, titre, extrait, cat, date, readTime

Refactorisations (composants → content layer) :
- Navbar, Footer : importent siteConfig directement (client component)
- app/page.tsx : async, Promise.all sur getServices/getTestimonials/getFAQ/getValues/getPartners/getRealisations
- app/services/page.tsx : getServices() + getSiteConfig()
- app/contact/page.tsx : getSiteConfig() pour phone, email, address, zones
- app/realisations/page.tsx : getRealisations() + getSiteConfig()
- app/partenaires/page.tsx : getPartners()
- app/blog/page.tsx : getBlogPosts()
- app/blog/[slug]/page.tsx : getBlogPost() + getBlogPosts() pour generateStaticParams
- LocalSEOPage.tsx : siteConfig pour services list, phone, address
- 5 pages service (construction-maison, renovation, assainissement, creation-acces, demolition) : getSiteConfig() pour phone
- Pages légales et SEO locales : siteConfig importé pour données dynamiques

Corrections URL :
- Toutes les URLs canoniques obc-maconnerie.fr → obc-terrassement.fr (30+ fichiers)
- layout.tsx : BASE_URL depuis siteConfig.url
- robots.ts, sitemap.ts : BASE_URL depuis siteConfig.url
- api/contact/route.ts : email fallback → obc-terrassement.fr

https://claude.ai/code/session_01Uec4iHjcPwB1pU41idWEdF
2026-02-27 13:05:19 +00:00

93 lines
4.3 KiB
TypeScript

import type { Metadata } from "next";
import Link from "next/link";
import Navbar from "@/components/marketing/Navbar";
import Footer from "@/components/marketing/Footer";
import ScrollReveal from "@/components/animations/ScrollReveal";
import { getServices, getSiteConfig } from "@/lib/content";
export const metadata: Metadata = {
title: "Nos Services | Construction, Rénovation, Assainissement",
description:
"Tous les services d'OBC Maçonnerie : construction de maison, rénovation, assainissement, création d'accès et démolition dans le Nord (59). Devis gratuit.",
alternates: { canonical: "https://obc-terrassement.fr/services" },
};
export default async function ServicesPage() {
const [services, config] = await Promise.all([getServices(), getSiteConfig()]);
const { phone, phoneRaw } = config;
return (
<main id="main-content" className="min-h-screen">
<Navbar />
<section className="bg-navy py-16 md:py-20">
<div className="max-w-4xl mx-auto px-4 sm:px-6 text-center">
<ScrollReveal direction="up">
<span className="text-orange text-sm font-semibold uppercase tracking-widest">OBC Maçonnerie</span>
<h1 className="text-3xl md:text-5xl font-bold text-white mt-2 mb-4">Nos services de maçonnerie</h1>
<p className="text-white/70 text-lg max-w-xl mx-auto">
Construction, rénovation, assainissement et gros œuvre dans le Nord Benoît Colin vous accompagne de A à Z.
</p>
</ScrollReveal>
</div>
</section>
<section className="py-16 md:py-20 bg-bg">
<div className="max-w-5xl mx-auto px-4 sm:px-6 space-y-8">
{services.map((s, i) => {
const href = s.slug === "conseil" ? "/contact" : `/${s.slug}`;
return (
<ScrollReveal key={s.slug} direction="up" delay={i * 60}>
<div className="bg-bg-white border border-border rounded-2xl p-6 md:p-8 flex flex-col md:flex-row gap-6">
<div className="text-5xl shrink-0">{s.icon}</div>
<div className="flex-1">
<h2 className="text-xl font-bold text-navy mb-2">{s.title}</h2>
<p className="text-text-light text-sm leading-relaxed mb-4">{s.longDescription}</p>
<div className="flex flex-wrap gap-2 mb-5">
{s.keywords.map((k) => (
<span key={k} className="bg-bg-muted text-text-light text-xs font-medium px-3 py-1 rounded-full">
{k}
</span>
))}
</div>
<Link
href={href}
className="inline-flex items-center gap-1.5 text-orange font-semibold text-sm hover:underline"
>
En savoir plus
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M17 8l4 4m0 0l-4 4m4-4H3" />
</svg>
</Link>
</div>
</div>
</ScrollReveal>
);
})}
</div>
</section>
<section className="py-16 bg-stone-bg">
<div className="max-w-2xl mx-auto px-4 text-center">
<ScrollReveal direction="up">
<h2 className="text-2xl md:text-3xl font-bold text-navy mb-4">Vous avez un projet ? Parlons-en.</h2>
<p className="text-text-light mb-6">
Benoît se déplace gratuitement pour évaluer votre projet et vous remettre un devis détaillé.
</p>
<div className="flex flex-col sm:flex-row gap-4 justify-center">
<Link href="/contact" className="inline-flex items-center justify-center gap-2 bg-orange hover:bg-orange-hover text-white font-bold px-7 py-3.5 rounded-xl transition-colors">
Demander un devis gratuit
</Link>
<a href={`tel:${phoneRaw}`} className="inline-flex items-center justify-center gap-2 border-2 border-navy text-navy hover:bg-navy hover:text-white font-bold px-7 py-3.5 rounded-xl transition-colors">
{phone}
</a>
</div>
</ScrollReveal>
</div>
</section>
<Footer />
</main>
);
}