From 162524e5b015c78abd691ce7957394048f16c489 Mon Sep 17 00:00:00 2001 From: Thatsaphorn Atchariyaphap Date: Sun, 8 Jun 2025 22:14:32 +0200 Subject: [PATCH] Use `basePath` for internal links and export from `next.config.ts` --- lawfirm-demos/demo-1/app/layout.tsx | 4 +++- lawfirm-demos/demo-1/app/page.tsx | 3 ++- lawfirm-demos/demo-1/components/Footer.tsx | 7 ++++--- lawfirm-demos/demo-1/components/Navbar.tsx | 11 ++++++----- lawfirm-demos/demo-1/next.config.ts | 4 ++-- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lawfirm-demos/demo-1/app/layout.tsx b/lawfirm-demos/demo-1/app/layout.tsx index 3ee7bdf..1c13bf9 100644 --- a/lawfirm-demos/demo-1/app/layout.tsx +++ b/lawfirm-demos/demo-1/app/layout.tsx @@ -2,6 +2,7 @@ import "./globals.css"; import {Inter} from "next/font/google"; import Navbar from "@/components/Navbar"; import Footer from "@/components/Footer"; +import React from "react"; const inter = Inter({subsets: ["latin"]}); @@ -10,7 +11,8 @@ export const metadata = { description: "Kompetente Rechtsberatung in allen Lebenslagen", }; -export default function RootLayout({children}: { children: React.ReactNode }) { +export default function RootLayout( + {children}: Readonly<{ children: React.ReactNode }>) { return ( diff --git a/lawfirm-demos/demo-1/app/page.tsx b/lawfirm-demos/demo-1/app/page.tsx index 2b31189..3461173 100644 --- a/lawfirm-demos/demo-1/app/page.tsx +++ b/lawfirm-demos/demo-1/app/page.tsx @@ -4,6 +4,7 @@ import {motion} from 'framer-motion'; import Link from 'next/link'; import Image from 'next/image'; +import {basePath} from '@/next.config'; export default function HomePage() { return ( @@ -29,7 +30,7 @@ export default function HomePage() {

Persönliche Betreuung. Klare Kommunikation. Effektive Lösungen für Ihr Anliegen.

- + © {new Date().getFullYear()} Kanzlei Mustermann. Alle Rechte vorbehalten.

- Impressum - Datenschutz + Impressum + Datenschutz
); -} +} \ No newline at end of file diff --git a/lawfirm-demos/demo-1/components/Navbar.tsx b/lawfirm-demos/demo-1/components/Navbar.tsx index 350886d..60bf496 100644 --- a/lawfirm-demos/demo-1/components/Navbar.tsx +++ b/lawfirm-demos/demo-1/components/Navbar.tsx @@ -2,6 +2,7 @@ import Link from 'next/link'; import {motion} from 'framer-motion'; +import {basePath} from "@/next.config"; export default function Navbar() { return ( @@ -12,14 +13,14 @@ export default function Navbar() { className="fixed top-0 left-0 right-0 z-50 bg-white shadow-md py-4 px-6 md:px-12 lg:px-24 text-gray-900" >
- + Kanzlei Mustermann
- Start - Über uns - Impressum - Datenschutz + Start + Über uns + Impressum + Datenschutz
diff --git a/lawfirm-demos/demo-1/next.config.ts b/lawfirm-demos/demo-1/next.config.ts index b303e29..8746879 100644 --- a/lawfirm-demos/demo-1/next.config.ts +++ b/lawfirm-demos/demo-1/next.config.ts @@ -2,8 +2,8 @@ import type {NextConfig} from "next"; const isProd = process.env.NODE_ENV === 'production'; -const basePath = isProd ? '/lawfirm/demo1' : ''; -const assetPrefix = isProd ? '/lawfirm/demo1' : ''; +export const basePath = isProd ? '/lawfirm/demo1' : ''; +export const assetPrefix = isProd ? '/lawfirm/demo1' : ''; console.log(`🚀 [next.config.ts] Running in ${process.env.NODE_ENV} mode`); console.log(`👉 basePath: ${basePath || '(none)'}`);