fix(navbar): eliminate hardcoded names and make navbar and categories 100% dynamic JSON-driven

This commit is contained in:
2026-11-11 11:20:04 +05:30
parent 4afbf80709
commit 1e675d56fa
6 changed files with 94 additions and 79 deletions
+9 -2
View File
@@ -1,7 +1,7 @@
import type { Metadata } from 'next';
import { Poppins, Inter, JetBrains_Mono } from 'next/font/google';
import './globals.css';
import { getSiteConfig } from '@/lib/config/loader';
import { getSiteConfig, getAllCategories, getAllTools } from '@/lib/config/loader';
import { Navbar } from '@/components/ui/Navbar';
import { Footer } from '@/components/ui/Footer';
import { SmoothScrollProvider } from '@/components/ui/SmoothScrollProvider';
@@ -70,6 +70,8 @@ export default function RootLayout({
children: React.ReactNode;
}) {
const config = getSiteConfig();
const categories = getAllCategories();
const tools = getAllTools();
const siteUrl = process.env.SITE_URL || config.seo.siteUrl || 'http://localhost:3000';
// Root Schema.org JSON-LD for Organization & WebSite
@@ -96,7 +98,12 @@ export default function RootLayout({
<body className="min-h-screen flex flex-col antialiased bg-paper text-ink relative font-sans overflow-x-clip">
<SmoothScrollProvider>
<a href="#main-content" className="skip-link">Skip to main content</a>
<Navbar config={config} currentLocale="en" />
<Navbar
config={config}
currentLocale="en"
categories={categories}
totalToolsCount={tools.length}
/>
<main id="main-content" className="flex-1">{children}</main>
<Footer config={config} currentLocale="en" />
</SmoothScrollProvider>