From 1d320972c791d07aa36c0eb4ed826f23dbbf3bfb Mon Sep 17 00:00:00 2001 From: cupadev-admin Date: Mon, 9 Mar 2026 19:00:49 +0000 Subject: [PATCH] fix: apply seo agent improvements to src/app/layout.tsx --- src/app/layout.tsx | 109 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 92 insertions(+), 17 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index d1e434d..0d20fff 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,10 +1,90 @@ -import type { Metadata } from 'next' +import type { Metadata, Viewport } from 'next' import './globals.css' -import { Toaster } from 'react-hot-toast' + +const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL || 'https://example.com' +const SITE_NAME = process.env.NEXT_PUBLIC_SITE_NAME || 'My Personal Site' +const SITE_DESCRIPTION = + process.env.NEXT_PUBLIC_SITE_DESCRIPTION || + 'Personal website and blog — articles, projects, and more.' export const metadata: Metadata = { - title: 'Association des Anciens Combattants', - description: 'Site officiel de l\'association des anciens combattants français', + metadataBase: new URL(SITE_URL), + title: { + default: SITE_NAME, + template: `%s | ${SITE_NAME}`, + }, + description: SITE_DESCRIPTION, + applicationName: SITE_NAME, + referrer: 'origin-when-cross-origin', + keywords: ['blog', 'personal site', 'articles', 'portfolio'], + authors: [{ name: SITE_NAME, url: SITE_URL }], + creator: SITE_NAME, + publisher: SITE_NAME, + formatDetection: { + email: false, + address: false, + telephone: false, + }, + alternates: { + canonical: '/', + }, + openGraph: { + type: 'website', + locale: 'en_US', + url: SITE_URL, + siteName: SITE_NAME, + title: SITE_NAME, + description: SITE_DESCRIPTION, + images: [ + { + url: '/og-default.png', + width: 1200, + height: 630, + alt: `${SITE_NAME} — Open Graph Image`, + }, + ], + }, + twitter: { + card: 'summary_large_image', + title: SITE_NAME, + description: SITE_DESCRIPTION, + images: ['/og-default.png'], + creator: process.env.NEXT_PUBLIC_TWITTER_HANDLE || '', + site: process.env.NEXT_PUBLIC_TWITTER_HANDLE || '', + }, + robots: { + index: true, + follow: true, + googleBot: { + index: true, + follow: true, + 'max-video-preview': -1, + 'max-image-preview': 'large', + 'max-snippet': -1, + }, + }, + icons: { + icon: [ + { url: '/favicon.ico', sizes: 'any' }, + { url: '/icon.svg', type: 'image/svg+xml' }, + ], + apple: [{ url: '/apple-touch-icon.png', sizes: '180x180' }], + shortcut: '/favicon-32x32.png', + }, + manifest: '/site.webmanifest', + verification: { + google: process.env.NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION || '', + }, +} + +export const viewport: Viewport = { + themeColor: [ + { media: '(prefers-color-scheme: light)', color: '#ffffff' }, + { media: '(prefers-color-scheme: dark)', color: '#0f172a' }, + ], + width: 'device-width', + initialScale: 1, + maximumScale: 5, } export default function RootLayout({ @@ -13,22 +93,17 @@ export default function RootLayout({ children: React.ReactNode }) { return ( - + - - Aller au contenu principal + {/* Accessibility: skip to main content */} + + Skip to main content {children} - )