From c9ccba7045f1127be0d89bf941b9ba381e2cb722 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 14:43:11 +0200 Subject: [PATCH 1/2] Update dependency sass to v1.77.0 (#30200) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 399dae2057..95a3923e25 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15320,15 +15320,15 @@ __metadata: linkType: hard "sass@npm:^1.62.1": - version: 1.76.0 - resolution: "sass@npm:1.76.0" + version: 1.77.0 + resolution: "sass@npm:1.77.0" dependencies: chokidar: "npm:>=3.0.0 <4.0.0" immutable: "npm:^4.0.0" source-map-js: "npm:>=0.6.2 <2.0.0" bin: sass: sass.js - checksum: 10c0/976baf2c378e104f8d4ffca5375c8aa6f3d24f59d5c0a5db8d68a51f89edce45dedc25cfcd304b309fc8568d146de9e2c6cd189395e97bb2840d39feb13932ff + checksum: 10c0/bce0e5f5b535491e4e775045a79f19cbe10d800ef53b5f7698958d2992505d7b124c968169b05a0190842d8e0a24c2aa6d75dfbdd7c213820d9d59e227009c19 languageName: node linkType: hard From d8c428472356abd70aaf1f514b99114464ee7f61 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 7 May 2024 20:15:17 +0200 Subject: [PATCH 2/2] Ensure custom favicon is converted to PNG and ICO (#30208) --- app/models/site_upload.rb | 19 +++++++++++++++++-- app/views/layouts/application.html.haml | 2 +- config/imagemagick/policy.xml | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/app/models/site_upload.rb b/app/models/site_upload.rb index b3926ec7ed..6431d1007d 100644 --- a/app/models/site_upload.rb +++ b/app/models/site_upload.rb @@ -26,8 +26,23 @@ class SiteUpload < ApplicationRecord APP_ICON_SIZES = (APPLE_ICON_SIZES + ANDROID_ICON_SIZES).uniq.freeze STYLES = { - app_icon: APP_ICON_SIZES.each_with_object({}) { |size, hash| hash[size.to_s.to_sym] = "#{size}x#{size}#" }.freeze, - favicon: FAVICON_SIZES.each_with_object({}) { |size, hash| hash[size.to_s.to_sym] = "#{size}x#{size}#" }.freeze, + app_icon: + APP_ICON_SIZES.to_h do |size| + [:"#{size}", { format: 'png', geometry: "#{size}x#{size}#", file_geometry_parser: FastGeometryParser }] + end.freeze, + + favicon: { + ico: { + format: 'ico', + geometry: '48x48#', + file_geometry_parser: FastGeometryParser, + }.freeze, + }.merge( + FAVICON_SIZES.to_h do |size| + [:"#{size}", { format: 'png', geometry: "#{size}x#{size}#", file_geometry_parser: FastGeometryParser }] + end + ).freeze, + thumbnail: { '@1x': { format: 'png', diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 56857b2b63..e3d05226ee 100755 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -11,7 +11,7 @@ - if storage_host? %link{ rel: 'dns-prefetch', href: storage_host }/ - %link{ rel: 'icon', href: site_icon_path('favicon') || '/favicon.ico', type: 'image/x-icon' }/ + %link{ rel: 'icon', href: site_icon_path('favicon', 'ico') || '/favicon.ico', type: 'image/x-icon' }/ - SiteUpload::FAVICON_SIZES.each do |size| %link{ rel: 'icon', sizes: "#{size}x#{size}", href: site_icon_path('favicon', size.to_i) || frontend_asset_path("icons/favicon-#{size}x#{size}.png"), type: 'image/png' }/ diff --git a/config/imagemagick/policy.xml b/config/imagemagick/policy.xml index e2aa202f27..2730a9f84e 100644 --- a/config/imagemagick/policy.xml +++ b/config/imagemagick/policy.xml @@ -23,5 +23,5 @@ - +