diff --git a/config/site.yaml b/config/site.yaml index 166b129..166fe66 100644 --- a/config/site.yaml +++ b/config/site.yaml @@ -30,7 +30,7 @@ build: # Change this by your legals legals: hoster_name: - hoster_adress: + hoster_address: hoster_contact: intellectual_property: - paragraph: "" diff --git a/src/py/webui/webui.py b/src/py/webui/webui.py index f452f1a..dbf7810 100644 --- a/src/py/webui/webui.py +++ b/src/py/webui/webui.py @@ -210,9 +210,21 @@ def get_site_info(): @app.route("/api/site-info", methods=["POST"]) def update_site_info(): """Update site info YAML.""" - data = request.json + new_data = request.json + with open(SITE_YAML, "r") as f: + old_data = yaml.safe_load(f) or {} + + def deep_merge(old, new): + for k, v in new.items(): + if isinstance(v, dict) and isinstance(old.get(k), dict): + old[k] = deep_merge(old[k], v) + else: + old[k] = v + return old + + merged = deep_merge(old_data, new_data) with open(SITE_YAML, "w") as f: - yaml.safe_dump(data, f, sort_keys=False, allow_unicode=True) + yaml.safe_dump(merged, f, sort_keys=False, allow_unicode=True) return jsonify({"status": "ok"}) # --- Theme management ---