feat(config): include default pages and site_info in configLoader fallbacks
This commit is contained in:
@@ -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<ThemeConfig>(themePath, FALLBACK_THEME_CONFIG);
|
||||
const smtpConfig = readJsonFile<SmtpConfig>(smtpPath, FALLBACK_SMTP_CONFIG);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user