From 30b407d2e8751a8b427dd0fdded683374593bb56 Mon Sep 17 00:00:00 2001 From: Daniel S Date: Sun, 9 Aug 2026 22:58:54 +0200 Subject: [PATCH] feat(admin): add global header and footer configuration fields in admin dashboard --- src/pages/admin/index.astro | 61 +++++++++++++++++++++++++++++++++++++ src/pages/api/config.ts | 5 ++- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/src/pages/admin/index.astro b/src/pages/admin/index.astro index 86815eb..6203775 100644 --- a/src/pages/admin/index.astro +++ b/src/pages/admin/index.astro @@ -100,8 +100,55 @@ const presets = Object.values(THEME_PRESETS); + + +

Globaler Header / Navigation Bar

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + +
+ + +

Globaler Footer

+
+
+ + +
+
+ + +
+ +
+ @@ -193,9 +240,23 @@ const presets = Object.values(THEME_PRESETS); email: getVal('infoEmail'), phone: getVal('infoPhone'), address: getVal('infoAddress') + }, + header: { + brandName: getVal('headerBrandName'), + brandHighlight: getVal('headerBrandHighlight'), + ctaText: getVal('headerCtaText'), + ctaLink: getVal('headerCtaLink'), + showThemeToggle: getBool('headerShowThemeToggle'), + glassEffect: getBool('headerGlassEffect') + }, + footer: { + brandDescription: getVal('footerBrandDescription'), + copyrightText: getVal('footerCopyrightText'), + showLegalLinks: getBool('footerShowLegalLinks') } }, + themeConfig: { activePreset: selectedPreset }, diff --git a/src/pages/api/config.ts b/src/pages/api/config.ts index cbd2d44..db7c3ca 100644 --- a/src/pages/api/config.ts +++ b/src/pages/api/config.ts @@ -20,8 +20,11 @@ export const POST: APIRoute = async ({ request }) => { ...currentSite, ...body.siteConfig, hero: { ...(currentSite.hero || {}), ...(body.siteConfig.hero || {}) }, - site_info: { ...((currentSite as any).site_info || {}), ...(body.siteConfig.site_info || {}) } + site_info: { ...((currentSite as any).site_info || {}), ...(body.siteConfig.site_info || {}) }, + header: { ...(currentSite.header || {}), ...(body.siteConfig.header || {}) }, + footer: { ...(currentSite.footer || {}), ...(body.siteConfig.footer || {}) } }; + const sitePath = path.join(dataDir, 'site.config.json'); const draftPath = path.join(dataDir, 'site.config.draft.json'); fs.writeFileSync(sitePath, JSON.stringify(newSite, null, 2), 'utf8');