fix: apply designer agent improvements to src/app/layout.tsx
This commit is contained in:
parent
3ca2f051cf
commit
fa5bf8df06
|
|
@ -1,109 +1,48 @@
|
|||
import type { Metadata, Viewport } from 'next'
|
||||
import type { Metadata } from 'next'
|
||||
import { Toaster } from 'react-hot-toast'
|
||||
import './globals.css'
|
||||
|
||||
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 = {
|
||||
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 || '',
|
||||
},
|
||||
title: { default: 'CMS', template: '%s | CMS' },
|
||||
description: 'Personal Content Management System',
|
||||
}
|
||||
|
||||
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({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="en" dir="ltr">
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<head>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
|
||||
</head>
|
||||
<body>
|
||||
{/* Accessibility: skip to main content */}
|
||||
<a
|
||||
href="#main-content"
|
||||
className="skip-link"
|
||||
aria-label="Skip to main content"
|
||||
className="sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-[9999] focus:px-4 focus:py-2 focus:bg-blue-600 focus:text-white focus:rounded-lg focus:text-sm focus:font-medium"
|
||||
>
|
||||
Skip to main content
|
||||
</a>
|
||||
{children}
|
||||
<Toaster
|
||||
position="top-right"
|
||||
toastOptions={{
|
||||
duration: 3500,
|
||||
style: {
|
||||
background: '#0f172a',
|
||||
color: '#f8fafc',
|
||||
fontSize: '14px',
|
||||
fontWeight: '500',
|
||||
borderRadius: '10px',
|
||||
padding: '12px 16px',
|
||||
boxShadow: '0 10px 15px -3px rgb(0 0 0 / 0.2)',
|
||||
},
|
||||
success: {
|
||||
iconTheme: { primary: '#34d399', secondary: '#0f172a' },
|
||||
},
|
||||
error: {
|
||||
iconTheme: { primary: '#f87171', secondary: '#0f172a' },
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue