From 0a1aa5030d12bcd9002b2f0f872eec94065d58f1 Mon Sep 17 00:00:00 2001 From: Daniel S Date: Sun, 9 Aug 2026 22:24:28 +0200 Subject: [PATCH] feat(config): include default pages and site_info in configLoader fallbacks --- src/utils/configLoader.ts | 41 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/utils/configLoader.ts b/src/utils/configLoader.ts index f9f63d2..015e111 100644 --- a/src/utils/configLoader.ts +++ b/src/utils/configLoader.ts @@ -175,9 +175,45 @@ export const FALLBACK_SITE_CONFIG: SiteConfig = { { id: 'hero', type: 'hero', title: 'Hero Sektion', elements: [ { id: 'el-1', slotId: 'hero-badge-slot', type: 'badge', content: 'WaaS Engine' } ] }, { id: 'bento', type: 'bento', title: 'Bento Grid', elements: [] }, { id: 'contact', type: 'contact', title: 'Contact Section', elements: [] } + ], + site_info: { + title: 'N&D IT Solutions', + homepage_id: 'page_home' + }, + pages: [ + { + id: 'page_home', + slug: '/', + title: 'Startseite (Hauptseite)', + is_published: true, + sections: [ + { id: 'hero', type: 'HeroSection', settings: {} }, + { id: 'bento', type: 'BentoGrid', settings: {} }, + { id: 'contact', type: 'ContactSection', settings: {} } + ] + }, + { + id: 'page_templates', + slug: '/templates', + title: 'Templates & Design-Muster', + is_published: true, + sections: [ + { id: 'hero_templates', type: 'HeroSection', settings: { title: 'Templates', subtitle: 'Unsere fertigen Design-Vorlagen' } } + ] + }, + { + id: 'page_privacy', + slug: '/datenschutz', + title: 'Datenschutzerklärung', + is_published: true, + sections: [ + { id: 'privacy_content', type: 'HeroSection', settings: { title: 'Datenschutz', subtitle: '100% DSGVO-konforme Datenverarbeitung.' } } + ] + } ] }; + export const FALLBACK_THEME_CONFIG: ThemeConfig = { activePreset: 'corporateDark' }; @@ -239,9 +275,12 @@ export function loadWaasConfigs(userAgent: string = '', isDraft: boolean = false ...rawSite, hero: { ...FALLBACK_SITE_CONFIG.hero, ...(rawSite.hero || {}) }, bento: { ...FALLBACK_SITE_CONFIG.bento, ...(rawSite.bento || {}) }, - contact: { ...FALLBACK_SITE_CONFIG.contact, ...(rawSite.contact || {}) } + contact: { ...FALLBACK_SITE_CONFIG.contact, ...(rawSite.contact || {}) }, + pages: (rawSite as any).pages && (rawSite as any).pages.length > 0 ? (rawSite as any).pages : (FALLBACK_SITE_CONFIG as any).pages, + site_info: { ...(FALLBACK_SITE_CONFIG as any).site_info, ...((rawSite as any).site_info || {}) } }; + const themeConfig = readJsonFile(themePath, FALLBACK_THEME_CONFIG); const smtpConfig = readJsonFile(smtpPath, FALLBACK_SMTP_CONFIG);