Drop favicon.ico generation (#30375)
This commit is contained in:
parent
2b43c05a6a
commit
7a84b76bb1
6 changed files with 4 additions and 16 deletions
|
@ -31,17 +31,10 @@ class SiteUpload < ApplicationRecord
|
||||||
[:"#{size}", { format: 'png', geometry: "#{size}x#{size}#", file_geometry_parser: FastGeometryParser }]
|
[:"#{size}", { format: 'png', geometry: "#{size}x#{size}#", file_geometry_parser: FastGeometryParser }]
|
||||||
end.freeze,
|
end.freeze,
|
||||||
|
|
||||||
favicon: {
|
favicon:
|
||||||
ico: {
|
|
||||||
format: 'ico',
|
|
||||||
geometry: '48x48#',
|
|
||||||
file_geometry_parser: FastGeometryParser,
|
|
||||||
}.freeze,
|
|
||||||
}.merge(
|
|
||||||
FAVICON_SIZES.to_h do |size|
|
FAVICON_SIZES.to_h do |size|
|
||||||
[:"#{size}", { format: 'png', geometry: "#{size}x#{size}#", file_geometry_parser: FastGeometryParser }]
|
[:"#{size}", { format: 'png', geometry: "#{size}x#{size}#", file_geometry_parser: FastGeometryParser }]
|
||||||
end
|
end.freeze,
|
||||||
).freeze,
|
|
||||||
|
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
'@1x': {
|
'@1x': {
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
- if storage_host?
|
- if storage_host?
|
||||||
%link{ rel: 'dns-prefetch', href: storage_host }/
|
%link{ rel: 'dns-prefetch', href: storage_host }/
|
||||||
|
|
||||||
%link{ rel: 'icon', href: favicon_path('ico') || '/favicon.ico', type: 'image/x-icon' }/
|
|
||||||
|
|
||||||
- SiteUpload::FAVICON_SIZES.each do |size|
|
- SiteUpload::FAVICON_SIZES.each do |size|
|
||||||
%link{ rel: 'icon', sizes: "#{size}x#{size}", href: favicon_path(size.to_i) || frontend_asset_path("icons/favicon-#{size}x#{size}.png"), type: 'image/png' }/
|
%link{ rel: 'icon', sizes: "#{size}x#{size}", href: favicon_path(size.to_i) || frontend_asset_path("icons/favicon-#{size}x#{size}.png"), type: 'image/png' }/
|
||||||
|
|
||||||
|
|
|
@ -23,5 +23,5 @@
|
||||||
<!-- Disallow any coder by default, and only enable ones required by Mastodon -->
|
<!-- Disallow any coder by default, and only enable ones required by Mastodon -->
|
||||||
<policy domain="coder" rights="none" pattern="*" />
|
<policy domain="coder" rights="none" pattern="*" />
|
||||||
<policy domain="coder" rights="read | write" pattern="{JPEG,PNG,GIF,WEBP,HEIC,AVIF}" />
|
<policy domain="coder" rights="read | write" pattern="{JPEG,PNG,GIF,WEBP,HEIC,AVIF}" />
|
||||||
<policy domain="coder" rights="write" pattern="{HISTOGRAM,RGB,INFO,ICO}" />
|
<policy domain="coder" rights="write" pattern="{HISTOGRAM,RGB,INFO}" />
|
||||||
</policymap>
|
</policymap>
|
||||||
|
|
|
@ -42,7 +42,6 @@ namespace :branding do
|
||||||
output_dest = Rails.root.join('app', 'javascript', 'icons')
|
output_dest = Rails.root.join('app', 'javascript', 'icons')
|
||||||
|
|
||||||
rsvg_convert = Terrapin::CommandLine.new('rsvg-convert', '-w :size -h :size --keep-aspect-ratio :input -o :output')
|
rsvg_convert = Terrapin::CommandLine.new('rsvg-convert', '-w :size -h :size --keep-aspect-ratio :input -o :output')
|
||||||
convert = Terrapin::CommandLine.new('convert', ':input :output', environment: { 'MAGICK_CONFIGURE_PATH' => nil })
|
|
||||||
|
|
||||||
favicon_sizes = [16, 32, 48]
|
favicon_sizes = [16, 32, 48]
|
||||||
apple_icon_sizes = [57, 60, 72, 76, 114, 120, 144, 152, 167, 180, 1024]
|
apple_icon_sizes = [57, 60, 72, 76, 114, 120, 144, 152, 167, 180, 1024]
|
||||||
|
@ -56,8 +55,6 @@ namespace :branding do
|
||||||
rsvg_convert.run(size: size, input: favicon_source, output: output_path)
|
rsvg_convert.run(size: size, input: favicon_source, output: output_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
convert.run(input: favicons, output: Rails.public_path.join('favicon.ico'))
|
|
||||||
|
|
||||||
apple_icon_sizes.each do |size|
|
apple_icon_sizes.each do |size|
|
||||||
rsvg_convert.run(size: size, input: app_icon_source, output: output_dest.join("apple-touch-icon-#{size}x#{size}.png"))
|
rsvg_convert.run(size: size, input: app_icon_source, output: output_dest.join("apple-touch-icon-#{size}x#{size}.png"))
|
||||||
end
|
end
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 15 KiB |
|
@ -9,7 +9,7 @@ describe 'The account show page' do
|
||||||
|
|
||||||
get '/@alice'
|
get '/@alice'
|
||||||
|
|
||||||
expect(head_link_icons.size).to eq(4) # One general favicon and three with sizes
|
expect(head_link_icons.size).to eq(3) # Three favicons with sizes
|
||||||
|
|
||||||
expect(head_meta_content('og:title')).to match alice.display_name
|
expect(head_meta_content('og:title')).to match alice.display_name
|
||||||
expect(head_meta_content('og:type')).to eq 'profile'
|
expect(head_meta_content('og:type')).to eq 'profile'
|
||||||
|
|
Loading…
Reference in a new issue