From 6b03ee30fae4b7080cf964242f6a34f431acd2ba Mon Sep 17 00:00:00 2001 From: Djeex Date: Tue, 2 Sep 2025 21:58:58 +0200 Subject: [PATCH] Fixes save menu issues --- config/site.yaml | 25 ++++++++++++++--------- config/themes/modern/theme.css | 3 --- config/themes/modern/theme.yaml | 5 ++++- config/themes/typewriter/theme.yaml | 2 ++ demo/config/themes/modern/theme.yaml | 3 +++ demo/config/themes/typewriter/theme.yaml | 2 ++ src/public/style/style.css | 26 +++++++++++++++++++----- src/webui/js/site-info.js | 10 +++++++-- 8 files changed, 55 insertions(+), 21 deletions(-) diff --git a/config/site.yaml b/config/site.yaml index 28e69e3..2545965 100644 --- a/config/site.yaml +++ b/config/site.yaml @@ -1,28 +1,33 @@ info: - title: null - subtitle: null - description: null - canonical: null - keywords: null - author: null + title: + subtitle: + description: + canonical: + keywords: + author: + social: - instagram_url: null + instagram_url: thumbnail: '' + menu: items: - label: Home href: / + footer: copyright: Copyright © 2025 legal_link: /legals/ legal_label: Legal notice + build: theme: modern convert_images: true resize_images: true + legals: - hoster_name: null - hoster_address: null - hoster_contact: null + hoster_name: + hoster_address: + hoster_contact: intellectual_property: - paragraph: '' diff --git a/config/themes/modern/theme.css b/config/themes/modern/theme.css index 84c8a73..c5cfab5 100644 --- a/config/themes/modern/theme.css +++ b/config/themes/modern/theme.css @@ -35,16 +35,13 @@ img, tag { #footer { box-shadow: 0px 20px 100px -44px rgba(0, 0, 0, 0.5); - margin: auto; } @media (max-width: 768px) { #footer { box-shadow: 0px 20px 100px -44px rgba(0, 0, 0, 0.5); - border-radius: 15px 15px 0 0; max-width: 1140px; - margin: 0; } .tag { diff --git a/config/themes/modern/theme.yaml b/config/themes/modern/theme.yaml index 68a07e1..db895de 100644 --- a/config/themes/modern/theme.yaml +++ b/config/themes/modern/theme.yaml @@ -6,8 +6,10 @@ colors: text_dark: '#616161' background: '#FFFFFF' browser_color: '#FFFFFF' + favicon: path: favicon.png + fonts: primary: fallback: sans-serif @@ -15,8 +17,9 @@ fonts: secondary: fallback: serif name: Montserrat + google_fonts: -- family: '' +- family: 'Lato' weights: - '200' - '400' diff --git a/config/themes/typewriter/theme.yaml b/config/themes/typewriter/theme.yaml index fd251d0..32fde01 100644 --- a/config/themes/typewriter/theme.yaml +++ b/config/themes/typewriter/theme.yaml @@ -6,8 +6,10 @@ colors: primary_dark: '#005384' secondary: '#00B0F0' text_dark: '#616161' + favicon: path: favicon.png + fonts: primary: name: trixie.woff diff --git a/demo/config/themes/modern/theme.yaml b/demo/config/themes/modern/theme.yaml index 68a07e1..9142466 100644 --- a/demo/config/themes/modern/theme.yaml +++ b/demo/config/themes/modern/theme.yaml @@ -6,8 +6,10 @@ colors: text_dark: '#616161' background: '#FFFFFF' browser_color: '#FFFFFF' + favicon: path: favicon.png + fonts: primary: fallback: sans-serif @@ -15,6 +17,7 @@ fonts: secondary: fallback: serif name: Montserrat + google_fonts: - family: '' weights: diff --git a/demo/config/themes/typewriter/theme.yaml b/demo/config/themes/typewriter/theme.yaml index fd251d0..32fde01 100644 --- a/demo/config/themes/typewriter/theme.yaml +++ b/demo/config/themes/typewriter/theme.yaml @@ -6,8 +6,10 @@ colors: primary_dark: '#005384' secondary: '#00B0F0' text_dark: '#616161' + favicon: path: favicon.png + fonts: primary: name: trixie.woff diff --git a/src/public/style/style.css b/src/public/style/style.css index ce22718..a6dd15b 100644 --- a/src/public/style/style.css +++ b/src/public/style/style.css @@ -78,6 +78,8 @@ html,body { font-weight: 400; line-height:1.5; color:var(--color-primary-dark); + display: flex; + flex-direction: column; } html { @@ -237,12 +239,23 @@ h2 { /* Hero */ #hero { - height: 100%; - width: 100%; + min-height: 100vh; + flex: 1 0 auto; + display: flex; + flex-direction: column; } + +#hero .section { + height: 100%; + display: flex; + flex-direction: column; + width: 100%; +} + #hero .content-wrapper, #hero .section { height:100%; } + .hero-background { height: 66%; width: 100%; @@ -303,7 +316,6 @@ h2 { font-size: 22px; } - .gallery { padding-top: 15px; } @@ -341,6 +353,11 @@ h2 { /* Footer */ +#footer { + margin: auto 0 0 0; + width: 100%; +} + .navigation { text-align: center; padding-top: 40px; @@ -470,8 +487,7 @@ h2 { #legals.content-wrapper { max-width: 90%; - margin: auto; - margin-top: 50px; + margin: 50px auto; } .legals-content { diff --git a/src/webui/js/site-info.js b/src/webui/js/site-info.js index b349bdb..dec0787 100644 --- a/src/webui/js/site-info.js +++ b/src/webui/js/site-info.js @@ -463,6 +463,12 @@ document.addEventListener("DOMContentLoaded", () => { function isSectionSaved(section) { const values = getSectionValues(section); const config = loadedConfig[section] || {}; + function normalizeMenuItems(items) { + return (items || []).map(item => ({ + label: item.label || "", + href: item.href || "" + })); + } switch (section) { case "info": return Object.keys(values).every( @@ -477,8 +483,8 @@ document.addEventListener("DOMContentLoaded", () => { values.instagram_url === (config.instagram_url || "") && values.thumbnail === (config.thumbnail || ""); case "menu": - return JSON.stringify(values.items) === JSON.stringify(config.items || []); - case "footer": + return JSON.stringify(normalizeMenuItems(values.items)) === JSON.stringify(normalizeMenuItems(config.items)); + case "footer": return values.copyright && values.legal_label && values.copyright === (config.copyright || "") && values.legal_label === (config.legal_label || "");