feat: add favicon settings to site configuration

- Add Favicon field to SiteSetting model with FaviconIsURL() helper
- Implement favicon upload and management in site settings page
- Support both external URL and local file upload for favicon
- Add favicon display in page header with automatic URL detection
- Add i18n translations for favicon settings (EN/ZH)
- Update middleware and helpers to pass favicon data to templates
- Include migration script for existing databases

Users can now customize their site's favicon from /admin/settings/site
by either providing an external URL or uploading a local image file
(recommended formats: .ico, .png, .svg, 16x16 or 32x32 pixels).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 20:09:05 +08:00
co-authored by Claude Fable 5
parent da7a39c1c8
commit b600eac21c
9 changed files with 193 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
-- Migration: Add favicon field to site_settings table
-- Date: 2026-06-22
-- Description: Add support for custom favicon in site settings
-- Add favicon column if it doesn't exist
ALTER TABLE site_settings ADD COLUMN IF NOT EXISTS favicon VARCHAR(512) DEFAULT '';
-- Add comment for documentation
COMMENT ON COLUMN site_settings.favicon IS 'Local filename (served under /uploads/logos) OR a full URL for the site favicon';