bingo: serve real favicon files
The favicon was an emoji in a data: URI and /favicon.ico was a 404. Google only shows a site icon in results when the favicon has a crawlable URL, and the emoji looked different on every platform. Add an SVG (a 5x5 card with a crossed-out diagonal), a 16/32/48 ICO and a 180px apple-touch-icon under assets/bingo/, served by explicit routes because public/ belongs to asxp.io. Assisted-by: Claude:opus-5
This commit is contained in:
parent
d2d6ac1d99
commit
cb2eba1a26
6 changed files with 25 additions and 1 deletions
10
bingo_web.rb
10
bingo_web.rb
|
|
@ -111,6 +111,16 @@ class BingoWeb < Sinatra::Base
|
|||
erb :index
|
||||
end
|
||||
|
||||
# Icons from assets/bingo/ (public/ is asxp.io's). Search engines want
|
||||
# a crawlable favicon URL; a data: URI doesn't count.
|
||||
ICONS = { 'favicon.svg' => 'image/svg+xml', 'favicon.ico' => 'image/x-icon',
|
||||
'apple-touch-icon.png' => 'image/png' }.freeze
|
||||
|
||||
get %r{/(favicon\.svg|favicon\.ico|apple-touch-icon\.png)} do |name|
|
||||
cache_control :public, max_age: 86_400
|
||||
send_file File.join(settings.root, 'assets', 'bingo', name), type: ICONS[name]
|
||||
end
|
||||
|
||||
# Photos are immutable per key (a new upload gets a new key).
|
||||
get '/p/:file' do
|
||||
bytes, type = Bingo::Photo.read(params[:file])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue