feat: render CMS-driven public redesign
This commit is contained in:
@@ -6,6 +6,7 @@ import Navbar from "@/components/Navbar";
|
||||
import Footer from "@/components/Footer";
|
||||
import Providers from "@/components/providers";
|
||||
import RouteProgress from "@/components/RouteProgress";
|
||||
import { getCmsSiteContent } from "@/lib/content-cms";
|
||||
import { siteUrl } from "@/lib/site";
|
||||
import "../index.css";
|
||||
|
||||
@@ -17,21 +18,35 @@ const vazirmatn = localFont({
|
||||
fallback: ["Tahoma", "Arial", "sans-serif"],
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
metadataBase: new URL(siteUrl),
|
||||
title: {
|
||||
default: "انجمن علمی کامپیوتر شرق گیلان",
|
||||
template: "%s | انجمن علمی کامپیوتر شرق گیلان",
|
||||
},
|
||||
description:
|
||||
"انجمن علمی کامپیوتر شرق گیلان، برگزارکننده رویدادها، کارگاهها و محتوای آموزشی برای دانشجویان و علاقهمندان فناوری.",
|
||||
};
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const siteContent = await getCmsSiteContent();
|
||||
const title = siteContent.seo.title || siteContent.official_name;
|
||||
const description = siteContent.seo.description || siteContent.description;
|
||||
const image = siteContent.seo.image?.url || siteContent.logo?.url || `${siteUrl}/favicon.ico`;
|
||||
|
||||
export default function RootLayout({
|
||||
return {
|
||||
metadataBase: new URL(siteUrl),
|
||||
title: {
|
||||
default: title,
|
||||
template: `%s | ${siteContent.short_name || siteContent.official_name}`,
|
||||
},
|
||||
description,
|
||||
openGraph: {
|
||||
siteName: siteContent.official_name,
|
||||
images: [image],
|
||||
locale: "fa_IR",
|
||||
type: "website",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const siteContent = await getCmsSiteContent();
|
||||
|
||||
return (
|
||||
<html lang="fa" dir="rtl" suppressHydrationWarning>
|
||||
<body className={`${vazirmatn.variable} font-sans antialiased`}>
|
||||
@@ -39,12 +54,12 @@ export default function RootLayout({
|
||||
<Suspense fallback={null}>
|
||||
<RouteProgress />
|
||||
</Suspense>
|
||||
<Navbar />
|
||||
<Navbar siteContent={siteContent} />
|
||||
<div className="min-h-screen pb-28 md:pb-0">
|
||||
{children}
|
||||
<Footer />
|
||||
<Footer siteContent={siteContent} />
|
||||
</div>
|
||||
<MobileBottomNav />
|
||||
<MobileBottomNav siteContent={siteContent} />
|
||||
</Providers>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user