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
This commit is contained in:
@@ -3,50 +3,46 @@ import Navbar from "@/components/marketing/Navbar";
|
||||
import Footer from "@/components/marketing/Footer";
|
||||
import ScrollReveal from "@/components/animations/ScrollReveal";
|
||||
import ContactForm from "@/components/marketing/ContactForm";
|
||||
import { getSiteConfig } from "@/lib/content";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Contact & Devis Gratuit | OBC Maçonnerie Nord",
|
||||
description:
|
||||
"Contactez OBC Maçonnerie pour un devis gratuit. Benoît Colin intervient à Orchies, Douai, Valenciennes et dans un rayon de 30km autour de Mouchin (59).",
|
||||
alternates: { canonical: "https://obc-maconnerie.fr/contact" },
|
||||
};
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const config = await getSiteConfig();
|
||||
return {
|
||||
title: "Contact & Devis Gratuit | OBC Maçonnerie Nord",
|
||||
description:
|
||||
"Contactez OBC Maçonnerie pour un devis gratuit. Benoît Colin intervient à Orchies, Douai, Valenciennes et dans un rayon de 30km autour de Mouchin (59).",
|
||||
alternates: { canonical: `${config.url}/contact` },
|
||||
};
|
||||
}
|
||||
|
||||
const infos = [
|
||||
{
|
||||
icon: "📞",
|
||||
titre: "Téléphone",
|
||||
val: "06 74 45 30 89",
|
||||
href: "tel:0674453089",
|
||||
desc: "Lun–Ven 7h–19h",
|
||||
},
|
||||
{
|
||||
icon: "📍",
|
||||
titre: "Adresse",
|
||||
val: "221 Route de Saint-Amand, 59310 Mouchin",
|
||||
href: undefined,
|
||||
desc: "Rayon d'intervention : 30km",
|
||||
},
|
||||
{
|
||||
icon: "📧",
|
||||
titre: "Email",
|
||||
val: "contact@obc-maconnerie.fr",
|
||||
href: "mailto:contact@obc-maconnerie.fr",
|
||||
desc: "Réponse sous 24h",
|
||||
},
|
||||
];
|
||||
export default async function ContactPage() {
|
||||
const config = await getSiteConfig();
|
||||
const { phone, phoneRaw, email, address, zones, zoneDescription } = config;
|
||||
|
||||
const zones = [
|
||||
"Orchies",
|
||||
"Mouchin",
|
||||
"Flines-lès-Raches",
|
||||
"Château-l'Abbaye",
|
||||
"Mérignies",
|
||||
"Douai",
|
||||
"Valenciennes",
|
||||
"Saint-Amand-les-Eaux",
|
||||
];
|
||||
const infos = [
|
||||
{
|
||||
icon: "📞",
|
||||
titre: "Téléphone",
|
||||
val: phone,
|
||||
href: `tel:${phoneRaw}`,
|
||||
desc: "Lun–Ven 7h–19h",
|
||||
},
|
||||
{
|
||||
icon: "📍",
|
||||
titre: "Adresse",
|
||||
val: address,
|
||||
href: undefined as string | undefined,
|
||||
desc: "Rayon d'intervention : 30km",
|
||||
},
|
||||
{
|
||||
icon: "📧",
|
||||
titre: "Email",
|
||||
val: email,
|
||||
href: `mailto:${email}`,
|
||||
desc: "Réponse sous 24h",
|
||||
},
|
||||
];
|
||||
|
||||
export default function ContactPage() {
|
||||
return (
|
||||
<main id="main-content" className="min-h-screen">
|
||||
<Navbar />
|
||||
@@ -100,11 +96,11 @@ export default function ContactPage() {
|
||||
))}
|
||||
</div>
|
||||
<p className="text-text-muted text-xs italic">
|
||||
Et toutes les communes dans un rayon de 20-30 km autour de Mouchin (Nord 59).
|
||||
Et toutes les communes dans un rayon de {zoneDescription}.
|
||||
</p>
|
||||
|
||||
<div className="mt-8 bg-navy rounded-2xl p-6">
|
||||
<h3 className="text-white font-bold mb-2">Devis gratuit & sans engagement</h3>
|
||||
<h3 className="text-white font-bold mb-2">Devis gratuit & sans engagement</h3>
|
||||
<p className="text-white/60 text-sm">
|
||||
Benoît se déplace sur votre chantier pour évaluer votre projet, vous conseiller et vous remettre un devis clair et détaillé. Gratuit et sans engagement.
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user