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:
@@ -19,6 +19,8 @@ func DefaultData(c *gin.Context) gin.H {
|
||||
siteSetting, _ := c.Get("site_setting")
|
||||
siteLogo, _ := c.Get("site_logo")
|
||||
siteLogoIsURL, _ := c.Get("site_logo_is_url")
|
||||
siteFavicon, _ := c.Get("site_favicon")
|
||||
siteFaviconIsURL, _ := c.Get("site_favicon_is_url")
|
||||
siteLogoText, _ := c.Get("site_logo_text")
|
||||
siteHeaderText, _ := c.Get("site_header_text")
|
||||
siteHomeWelcome, _ := c.Get("site_home_welcome")
|
||||
@@ -37,6 +39,8 @@ func DefaultData(c *gin.Context) gin.H {
|
||||
"SiteSetting": siteSetting,
|
||||
"SiteLogo": siteLogo,
|
||||
"SiteLogoIsURL": siteLogoIsURL,
|
||||
"SiteFavicon": siteFavicon,
|
||||
"SiteFaviconIsURL": siteFaviconIsURL,
|
||||
"SiteLogoText": siteLogoText,
|
||||
"SiteHeaderText": siteHeaderText,
|
||||
"SiteHomeWelcome": siteHomeWelcome,
|
||||
|
||||
Reference in New Issue
Block a user