Fixed forms and key issues

This commit is contained in:
2025-09-01 22:13:16 +00:00
parent 3198755576
commit f8bebb9c95
2 changed files with 15 additions and 3 deletions

View File

@ -30,7 +30,7 @@ build:
# Change this by your legals # Change this by your legals
legals: legals:
hoster_name: hoster_name:
hoster_adress: hoster_address:
hoster_contact: hoster_contact:
intellectual_property: intellectual_property:
- paragraph: "" - paragraph: ""

View File

@ -210,9 +210,21 @@ def get_site_info():
@app.route("/api/site-info", methods=["POST"]) @app.route("/api/site-info", methods=["POST"])
def update_site_info(): def update_site_info():
"""Update site info YAML.""" """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: 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"}) return jsonify({"status": "ok"})
# --- Theme management --- # --- Theme management ---