Make favicon editable per page in /admin

Same emoji-based inline SVG favicon as before, but the emoji is now
a per-page "favicon" field editable in the header form instead of
hardcoded in the template.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
marcandClaude Sonnet 5 committed 2026-07-24 12:15:03 +02:00
1 parent 2a45abc0eb
commit 3a49d91c2e
4 files changed
+12 -3

No files matched your search

+3
View File
@@ -25,6 +25,7 @@ DEFAULT_DATA = {
"footer_label": "",
"footer_href": "",
"profile_image": "",
"favicon": "🍯",
"sections": [],
}
}
@@ -121,6 +122,7 @@ def edit_header(page_key):
page["footer_label"] = request.form.get("footer_label", page.get("footer_label", "")).strip()
page["footer_href"] = request.form.get("footer_href", page.get("footer_href", "")).strip()
page["profile_image"] = request.form.get("profile_image", page.get("profile_image", "")).strip()
page["favicon"] = request.form.get("favicon", page.get("favicon", "")).strip()
save_data(data)
return redirect(url_for("admin_dashboard"))
@@ -140,6 +142,7 @@ def add_page():
"footer_label": "",
"footer_href": "",
"profile_image": "",
"favicon": "🍯",
"sections": [],
}
save_data(data)
+4 -2
View File
@@ -89,7 +89,8 @@
}
]
}
]
],
"favicon": "🍯"
},
"honey": {
"title": "My Links",
@@ -181,6 +182,7 @@
}
]
}
]
],
"favicon": "🍯"
}
}
+4
View File
@@ -141,6 +141,10 @@
<label class="checkbox">Profilbild-URL</label>
<input type="text" name="profile_image" value="{{ page.profile_image or '' }}" placeholder="https://...">
</div>
<div>
<label class="checkbox">Favicon (Emoji)</label>
<input type="text" name="favicon" value="{{ page.favicon or '' }}" placeholder="🍯" style="width: 60px;">
</div>
<button type="submit">Header speichern</button>
</form>
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Honey | Links</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🍯</text></svg>">
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>{{ page.favicon or '🍯' }}</text></svg>">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet"/>
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
</head>