Files
websitedev/proto/src/app/layout.tsx
T
Do Siki 9f1fb349c2
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Waiting to run
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Blocked by required conditions
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Blocked by required conditions
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Waiting to run
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Blocked by required conditions
fix(web): hygiene — OG image/metadataBase, Header a11y text + nav flag, dead code
- siteConfig.ogImage pointed to an existing asset; metadataBase added so
  relative OG/Twitter URLs resolve against the real origin instead of localhost
- Header sr-only menu label moved to common.json (a11y.openMenu/closeMenu);
  navigation primary styling driven by a NavigationItem.primary flag instead
  of brittle 'Kapcsolat' string comparisons
- remove dead code: lib/site-config.ts (unused hybrid config) and the
  unused, schema-divergent siteConfig.contact.form
- ContactConfig type cleaned up (address/form removed)

Closes MITHOME-77
2026-08-22 12:12:48 +02:00

113 lines
3.3 KiB
TypeScript
Executable File

import type { Metadata, Viewport } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import Header from "../components/Header";
import Footer from "../components/Footer";
import { ThemeProvider } from "../components/ThemeProvider";
import { siteConfig } from "../config/site";
import { common } from "../content";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
// WHY metadataBase: without it Next resolves relative OG/twitter image URLs
// against localhost, producing broken social previews in production.
metadataBase: new URL(siteConfig.general.url),
title: `${siteConfig.general.name} | ${siteConfig.general.description}`,
description: siteConfig.general.description,
authors: [{ name: siteConfig.general.name }],
keywords: ["web hosting", "email szolgáltatás", "DNS adminisztráció", "IT szolgáltatás", "mozdIT"],
openGraph: {
title: siteConfig.general.name,
description: siteConfig.general.description,
url: siteConfig.general.url,
siteName: siteConfig.general.name,
images: [
{
url: siteConfig.general.ogImage,
width: 1200,
height: 630,
alt: siteConfig.general.name,
},
],
locale: siteConfig.general.locale,
type: "website",
},
twitter: {
card: "summary_large_image",
title: siteConfig.general.name,
description: siteConfig.general.description,
images: [siteConfig.general.ogImage],
},
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
"max-video-preview": -1,
"max-image-preview": "large",
"max-snippet": -1,
},
},
};
// Keep Safari's browser chrome neutral; only the in-page staging strip is amber.
export const viewport: Viewport = {
themeColor: '#ffffff',
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const isStaging = process.env.NEXT_PUBLIC_DEPLOY_ENV === 'staging';
return (
<html lang="hu" suppressHydrationWarning>
<head>
<script
dangerouslySetInnerHTML={{
__html: `
(function() {
const savedTheme = localStorage.getItem('theme');
if (savedTheme === 'dark') {
document.documentElement.setAttribute('data-theme', 'dark');
} else if (savedTheme === 'light') {
document.documentElement.setAttribute('data-theme', 'light');
}
})();
`,
}}
/>
</head>
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased min-h-screen flex flex-col`}
style={{ background: 'var(--color-background)', color: 'var(--color-foreground)' }}
>
<ThemeProvider>
{isStaging && (
<div className="bg-amber-400 px-4 py-2 text-center text-xs font-extrabold tracking-[0.18em] text-amber-950 sm:text-sm">
{common.staging.banner}
</div>
)}
<Header />
<main className="flex-1">
{children}
</main>
<Footer />
</ThemeProvider>
</body>
</html>
);
}