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:
+19
-2
@@ -1,7 +1,7 @@
|
||||
import type { ContactContent, ModeVariants } from "@/content/types";
|
||||
|
||||
const FALLBACK_SITE_URL = "https://example.com";
|
||||
const SITE_MODES = ["coming-soon", "full"] as const;
|
||||
const SITE_MODES = ["coming-soon", "maintenance", "full"] as const;
|
||||
|
||||
export type SiteMode = (typeof SITE_MODES)[number];
|
||||
|
||||
@@ -51,6 +51,15 @@ export const siteConfig = {
|
||||
githubUrl: normalizeExternalUrl(process.env.NEXT_PUBLIC_GITHUB_URL),
|
||||
};
|
||||
|
||||
export const legalConfig = {
|
||||
name: process.env.LEGAL_NAME?.trim() || siteConfig.ownerName,
|
||||
address: process.env.LEGAL_ADDRESS?.trim() || "",
|
||||
postalCode: process.env.LEGAL_POSTAL_CODE?.trim() || "",
|
||||
city: process.env.LEGAL_CITY?.trim() || "",
|
||||
country: process.env.LEGAL_COUNTRY?.trim() || "",
|
||||
vatId: process.env.LEGAL_VAT_ID?.trim() || "",
|
||||
};
|
||||
|
||||
export function getSiteMode(): SiteMode {
|
||||
const mode = process.env.NEXT_PUBLIC_SITE_MODE?.trim();
|
||||
return SITE_MODES.includes(mode as SiteMode) ? (mode as SiteMode) : "coming-soon";
|
||||
@@ -60,8 +69,16 @@ export function isComingSoonMode(): boolean {
|
||||
return getSiteMode() === "coming-soon";
|
||||
}
|
||||
|
||||
export function isMaintenanceMode(): boolean {
|
||||
return getSiteMode() === "maintenance";
|
||||
}
|
||||
|
||||
export function isSiteClosedMode(): boolean {
|
||||
return getSiteMode() !== "full";
|
||||
}
|
||||
|
||||
function getModeVariantKey(mode: SiteMode): keyof ModeVariants<unknown> {
|
||||
return mode === "coming-soon" ? "comingSoon" : "full";
|
||||
return mode === "full" ? "full" : "comingSoon";
|
||||
}
|
||||
|
||||
export function getModeValue<T>(variants: ModeVariants<T>): T {
|
||||
|
||||
Reference in New Issue
Block a user