bingo: SEO pass and resized photos
The bingo host fell through to asxp.io's public/, so crawlers got asxp.io's robots.txt pointing at asxp.io's sitemap (and the keys and invoice JS were served too). Turn static files off for BingoWeb and give it its own robots.txt and a sitemap with hreflang alternates. The card loaded 15.6 MB of full-size photos as cell backgrounds. Derive 480/1200 px WebP variants with ImageMagick on store (memory/area limits, input coder pinned to the sniffed type), render cells as <img> with lazy loading past the first two rows, and add an admin action that rebuilds variants from the stored originals. Head gets per-locale titles and descriptions carrying the live score, og:image from the latest hit, Twitter card, og:locale alternates, JSON-LD WebSite + ItemList, and Vary: Accept-Language on the redirect. Assisted-by: Claude:opus-5
This commit is contained in:
parent
70f1734c5d
commit
201a70b07b
11 changed files with 236 additions and 23 deletions
|
|
@ -25,11 +25,11 @@
|
|||
<div class="letters" aria-hidden="true"><% t(:letters).each do |ch| %><div><%= ch %></div><% end %></div>
|
||||
<div class="grid">
|
||||
<% b.cells.each_with_index do |dc, idx| %>
|
||||
<% photo = photo_path(dc) %>
|
||||
<% photo = photo_path(dc, 480) %>
|
||||
<button type="button" data-dlg="dlg-<%= dc.slug %>"
|
||||
class="cell<%= ' photo' if photo %><%= ' hit' if b.hit[idx] %><%= ' win' if b.win_cells.include?(idx) %>"
|
||||
<% if photo %>style="background-image: url('<%= photo %>')"<% end %>
|
||||
aria-label="<%= dc.l(:name, @locale) %><%= " — #{kind_label(dc.incidents.first.kind)}" if b.hit[idx] %>">
|
||||
<% if photo %><img class="bg" src="<%= photo %>" alt="" width="480" height="480" decoding="async"<%== ' loading="lazy"' if idx >= 10 %>><% end %>
|
||||
<div>
|
||||
<div class="n">#<%= idx + 1 %><%= " · #{mw(dc)}" if mw(dc) %></div>
|
||||
<% if dc.building? %><div class="tag"><%= t(:building) %></div><% end %>
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
<% b.cells.each do |dc| %>
|
||||
<dialog id="dlg-<%= dc.slug %>">
|
||||
<% if (photo = photo_path(dc)) %><img src="<%= photo %>" alt="<%= dc.l(:name, @locale) %>" loading="lazy"><% end %>
|
||||
<% if (photo = photo_path(dc, 1200)) %><img src="<%= photo %>" alt="<%= dc.l(:name, @locale) %>, <%= dc.l(:city, @locale) %>" loading="lazy" decoding="async"><% end %>
|
||||
<div class="body">
|
||||
<h3><%= dc.l(:name, @locale) %></h3>
|
||||
<div class="meta">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue