Ready for production deployment with Dockerfile and i18n support
This commit is contained in:
31
app/[lang]/layout.tsx
Normal file
31
app/[lang]/layout.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Oswald } from "next/font/google";
|
||||
import "../globals.css";
|
||||
import { getDictionary } from "../dictionaries";
|
||||
|
||||
const oswald = Oswald({
|
||||
subsets: ["latin", "latin-ext"],
|
||||
variable: "--font-oswald",
|
||||
});
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: string }> }) {
|
||||
const resolvedParams = await params;
|
||||
return {
|
||||
title: "Salmakis Group | Luxury Resort, Villas & Yachting",
|
||||
description: "Salmakis Group Gateway",
|
||||
};
|
||||
}
|
||||
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
params,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
params: Promise<{ lang: string }>;
|
||||
}>) {
|
||||
const resolvedParams = await params;
|
||||
return (
|
||||
<html lang={resolvedParams.lang} className={`${oswald.variable}`}>
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
18
app/[lang]/page.tsx
Normal file
18
app/[lang]/page.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import HeroSplit from "../components/HeroSplit";
|
||||
import AboutLegend from "../components/AboutLegend";
|
||||
import Footer from "../components/Footer";
|
||||
import { getDictionary } from "../dictionaries";
|
||||
|
||||
export default async function Home({ params }: { params: Promise<{ lang: string }> }) {
|
||||
const resolvedParams = await params;
|
||||
const lang = resolvedParams.lang as "en" | "tr";
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
return (
|
||||
<main>
|
||||
<HeroSplit dict={dict} currentLang={lang} />
|
||||
<AboutLegend dict={dict} />
|
||||
<Footer dict={dict} />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user