From 1e675d56fa83ac3d4f9286310ef7db65939bf12c Mon Sep 17 00:00:00 2001 From: vshnosngh Date: Wed, 11 Nov 2026 11:20:04 +0530 Subject: [PATCH] fix(navbar): eliminate hardcoded names and make navbar and categories 100% dynamic JSON-driven --- content/site.config.json | 21 +++- src/app/layout.tsx | 11 +- src/components/sections/ToolGridSection.tsx | 12 +- src/components/ui/Navbar.tsx | 121 ++++++++++---------- src/lib/config/loader.ts | 2 +- src/types/index.ts | 6 + 6 files changed, 94 insertions(+), 79 deletions(-) diff --git a/content/site.config.json b/content/site.config.json index 84cbed6..e2ac01f 100644 --- a/content/site.config.json +++ b/content/site.config.json @@ -35,11 +35,14 @@ "header": [ { "label": { "en": "Tools", "hi": "टूल्स" }, - "href": "/tools" + "href": "/tools", + "hasDropdown": true, + "badge": "14 tools" }, { "label": { "en": "Apps", "hi": "ऐप्स" }, - "href": "/apps" + "href": "/apps", + "badge": "iOS · Mac" }, { "label": { "en": "Pricing", "hi": "मूल्य निर्धारण" }, @@ -51,8 +54,18 @@ } ], "cta": { - "label": { "en": "Get the App", "hi": "ऐप प्राप्त करें" }, - "href": "/apps" + "label": { "en": "Try Tools Free", "hi": "टूल्स मुफ्त आज़माएं" }, + "href": "/tools" + }, + "toolsDropdown": { + "viewAllText": { + "en": "Explore all studio tools", + "hi": "सभी स्टूडियो टूल्स देखें" + }, + "tagline": { + "en": "Instant client GPU trial · Zero retention", + "hi": "त्वरित क्लाइंट जीपीयू परीक्षण · शून्य प्रतिधारण" + } } }, "footer": { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 280de39..c22807e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -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({ Skip to main content - +
{children}