The shop knows when it is open, and says so — to visitors and to Google

Three things a bakery's site should do that this one couldn't, all from the same fact.

THE HOURS WERE MARKUP, so the only thing the site could do with them was print them. A visitor at half
past two on a Sunday had to work out for themselves that the shop was shut. They are data now (Shop.WEEK),
and `Hours` reads them two ways: as the list the footer and the contact page print — consecutive days with
the same times collapsed into one line, the way a sign does it, instead of three hand-written rows — and
as an answer. The header now says "Open until 2:00pm", or "Closed · opens Tuesday at 7:00am", worked out
on the server in the shop's own timezone. Right now, on a Sunday evening, it says the latter.

THE SHOP IS NOW DESCRIBED TO A SEARCH ENGINE: schema.org Bakery in the head, with the address, the phone
number and those same opening times. For a shop whose customers find it by searching its town, that is the
difference between a blue link and a listing that shows "Open ⋅ closes 2pm" — and it cannot drift from
what the page says, because it is built from the same record. Serialised with Jackson rather than
string-built, so the day somebody interpolates a name into it, it is not an injection. (Jackson 3 —
`tools.jackson` — which is what Boot 4 ships; the fasterxml import does not compile.)

A SHARED LINK NOW HAS A PICTURE. og:image, og:image:alt and a large summary card: it was a grey box with a
title, which is what every link to this site has looked like in a message.

AND IT PRINTS. The catering page is a price list and a bakery prints price lists — Ctrl-P now gives the
prices on paper rather than a screenshot of a website: no chrome, no sage bands eating a cartridge, cards
that don't split across a page break, and the buttons that only exist to be clicked marked `no-print`.

Five new tests, all of them free of Spring, because this is a calculation over a constant: the week
collapses as a sign would write it, the minute of opening counts as open and the minute of closing does
not, and a Saturday afternoon is told when Tuesday starts.

Also swept the last one-off styles the earlier pass missed — max-w-3xl/4xl, an inline letter-spacing the
.h2 class already carries, and the mobile menu's link string.
This commit is contained in:
2026-07-26 19:27:41 -05:00
parent 007d298b36
commit 69af6c672e
13 changed files with 474 additions and 41 deletions
@@ -27,6 +27,10 @@
<meta property="og:title" th:content="${title}">
<meta property="og:description" th:content="${description}">
<meta property="og:url" th:content="${baseUrl + (path == '/' ? '' : path)}">
<!--/* Without an image a shared link is a grey box with a title. This is the storefront. */-->
<meta property="og:image" th:content="${shareImage}">
<meta property="og:image:alt" content="The Vine Coffeehouse + Bakery on Main Street, Princeville">
<meta name="twitter:card" content="summary_large_image">
<meta property="og:type" content="website">
<meta property="og:locale" content="en_US">
<meta name="keywords" content="bakery, coffeehouse, pastries, custom cakes, cinnamon rolls, paninis, Princeville IL">
@@ -34,6 +38,11 @@
<!--/* ?v= is the commit sha in a deployment. One hand-written stylesheet has no content hash in its
name, so without it a returning visitor keeps the CSS they cached before the deploy. */-->
<link rel="stylesheet" th:href="|/css/site.css?v=${build}|">
<!--/* The shop as a search engine reads it: a Bakery, its address, its phone number and its opening
times, from the same record the page prints. It is how a local shop gets "Open ⋅ closes 2pm"
next to its listing. Unescaped because it is JSON, written by Jackson — see StructuredData. */-->
<script type="application/ld+json" th:utext="${structuredData}"></script>
</head>
<body></body>
</html>