feat: full site build — Project/Melody schema (Option A), admin CRUD, public sections, uploads, email+SMTP, internal analytics, legal pages, docs
This commit is contained in:
+8
-9
@@ -1,11 +1,10 @@
|
||||
import type { Metadata } from "next";
|
||||
import type { ReactNode } from "react";
|
||||
import { siteConfig } from "@/lib/site";
|
||||
import { isComingSoonMode } from "@/lib/site";
|
||||
import { isSiteClosedMode, siteConfig } from "@/lib/site";
|
||||
import "./globals.css";
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
const comingSoon = isComingSoonMode();
|
||||
const siteClosed = isSiteClosedMode();
|
||||
|
||||
return {
|
||||
metadataBase: new URL(siteConfig.siteUrl),
|
||||
@@ -13,7 +12,7 @@ export function generateMetadata(): Metadata {
|
||||
default: "Diyaa",
|
||||
template: "%s | Diyaa",
|
||||
},
|
||||
description: comingSoon
|
||||
description: siteClosed
|
||||
? "Minimal coming soon page for the upcoming launch."
|
||||
: "Bilingual professional website built for private-server deployment.",
|
||||
applicationName: "Diyaa",
|
||||
@@ -21,7 +20,7 @@ export function generateMetadata(): Metadata {
|
||||
creator: "Diyaa",
|
||||
publisher: "Diyaa",
|
||||
alternates: {
|
||||
languages: comingSoon
|
||||
languages: siteClosed
|
||||
? {
|
||||
en: "/",
|
||||
"x-default": "/",
|
||||
@@ -36,11 +35,11 @@ export function generateMetadata(): Metadata {
|
||||
}
|
||||
|
||||
function getThemeScript() {
|
||||
const comingSoon = isComingSoonMode();
|
||||
const siteClosed = isSiteClosedMode();
|
||||
|
||||
return `
|
||||
(() => {
|
||||
const locale = ${comingSoon ? '"en"' : 'window.location.pathname.split("/").filter(Boolean)[0] === "en" ? "en" : "ar"'};
|
||||
const locale = ${siteClosed ? '"en"' : 'window.location.pathname.split("/").filter(Boolean)[0] === "en" ? "en" : "ar"'};
|
||||
const direction = locale === "ar" ? "rtl" : "ltr";
|
||||
document.documentElement.lang = locale;
|
||||
document.documentElement.dir = direction;
|
||||
@@ -56,10 +55,10 @@ function getThemeScript() {
|
||||
}
|
||||
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
const comingSoon = isComingSoonMode();
|
||||
const siteClosed = isSiteClosedMode();
|
||||
|
||||
return (
|
||||
<html lang={comingSoon ? "en" : "ar"} dir={comingSoon ? "ltr" : "rtl"} data-theme="dark" suppressHydrationWarning>
|
||||
<html lang={siteClosed ? "en" : "ar"} dir={siteClosed ? "ltr" : "rtl"} data-theme="dark" suppressHydrationWarning>
|
||||
<head>
|
||||
<script dangerouslySetInnerHTML={{ __html: getThemeScript() }} />
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user