HaulFare is a free US car shipping price guide. Quote requests go to one licensed auto transport broker, which confirms the actual price, so the site's job is to publish honest, current estimates. Nearly every page quotes a dollar figure, and those figures have to move when diesel or the season moves.
That is awkward for a static site: more than a hundred prerendered pages, much of them prose, must agree on what a 1,000 mile trip costs and move to new prices on the same day. Here is how we do it with Astro 7.
One pricing module, used everywhere
The model is one TypeScript file, src/lib/pricing.ts . Its core is a per-mile curve for an open trailer carrying a running sedan, linearly interpolated:
/** Base $/mile breakpoints (open, sedan), linearly interpolated.…