Add favicon configuration with auto-generation from PNG upload

- New "Favicon" tab in template config with media picker for PNG upload
- helper/favicon.php generates all standard sizes from source PNG using GD:
  - favicon.ico (16x16 + 32x32 embedded)
  - apple-touch-icon.png (180x180)
  - favicon-32x32.png, favicon-16x16.png
  - android-chrome-192x192.png, android-chrome-512x512.png
  - site.webmanifest for PWA icon discovery
- Generated files cached in images/favicons/ with timestamp checking
- Link tags auto-injected in <head> when favicon source is configured
- Language strings added for en-GB and en-US

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 13:45:34 -05:00
parent de5b4395cd
commit 96161f34ae
6 changed files with 210 additions and 0 deletions

View File

@@ -36,6 +36,12 @@ TPL_MOKOCASSIOPEIA_DRAWER_LEFT_ICON_DESC="Enter the Font-Awesome class for the l
TPL_MOKOCASSIOPEIA_DRAWER_RIGHT_ICON_LABEL="Drawer Right Icon CSS"
TPL_MOKOCASSIOPEIA_DRAWER_RIGHT_ICON_DESC="Enter the Font-Awesome class for the right drawer toggle (e.g. 'fas fa-chevron-right')."
; ===== Favicon =====
TPL_MOKOCASSIOPEIA_FAVICON_FIELDSET_LABEL="Favicon"
TPL_MOKOCASSIOPEIA_FAVICON_NOTE="<p>Upload a square <strong>PNG image</strong> (recommended 512×512 or larger). The template will automatically generate all required favicon sizes including ICO, Apple Touch Icon (180×180), and Android icons (192×192, 512×512). Generated files are cached in <code>images/favicons/</code>.</p>"
TPL_MOKOCASSIOPEIA_FAVICON_SOURCE_LABEL="Favicon Source Image"
TPL_MOKOCASSIOPEIA_FAVICON_SOURCE_DESC="Select a square PNG image to use as the site favicon. Recommended size: 512×512 pixels or larger."
; ===== Google =====
TPL_MOKOCASSIOPEIA_GOOGLE_FIELDSET_LABEL="Google"
TPL_MOKOCASSIOPEIA_GOOGLE_NOTE_TEXT="<h3>PLEASE NOTE:</h3>If fields are left blank, relative Google features will not be used"

View File

@@ -36,6 +36,12 @@ TPL_MOKOCASSIOPEIA_DRAWER_LEFT_ICON_DESC="Enter the Font-Awesome class for the l
TPL_MOKOCASSIOPEIA_DRAWER_RIGHT_ICON_LABEL="Drawer Right Icon CSS"
TPL_MOKOCASSIOPEIA_DRAWER_RIGHT_ICON_DESC="Enter the Font-Awesome class for the right drawer toggle (e.g. 'fas fa-chevron-right')."
; ===== Favicon =====
TPL_MOKOCASSIOPEIA_FAVICON_FIELDSET_LABEL="Favicon"
TPL_MOKOCASSIOPEIA_FAVICON_NOTE="<p>Upload a square <strong>PNG image</strong> (recommended 512×512 or larger). The template will automatically generate all required favicon sizes including ICO, Apple Touch Icon (180×180), and Android icons (192×192, 512×512). Generated files are cached in <code>images/favicons/</code>.</p>"
TPL_MOKOCASSIOPEIA_FAVICON_SOURCE_LABEL="Favicon Source Image"
TPL_MOKOCASSIOPEIA_FAVICON_SOURCE_DESC="Select a square PNG image to use as the site favicon. Recommended size: 512×512 pixels or larger."
; ===== Google =====
TPL_MOKOCASSIOPEIA_GOOGLE_FIELDSET_LABEL="Google"
TPL_MOKOCASSIOPEIA_GOOGLE_NOTE_TEXT="<h3>PLEASE NOTE:</h3>If fields are left blank, relative Google features will not be used"