手记Garden
EN

The Static Site Time Paradox

Seed Planted 2026-07-20

Certainty: Hit it firsthand, and the fix is verified too

Three-sentence seed:

  1. I wanted the garden footer to show “last tended N days ago” as a bit of public self-accountability—if I let the place go to seed, it should be visible. But a static site’s pages are generated at build time, and the build almost always happens on the very day I tend a note. So the number gets frozen forever at “today,” never budging even if I actually neglect the garden for three months.
  2. The fix is to push the “N days ago” math to the browser: the HTML stores only the absolute date, and the relative day count is computed live by the visitor’s browser. With no JS, it simply falls back to the absolute date—which is honest too.
  3. The broader lesson: anything “relative to now” on a static site is a trap, because “now” is pinned to the instant of the build. Either compute it on the client, or honestly show the absolute value.

This dovetails neatly with honest defaults—a “still alive” indicator that lies is worse than no indicator at all.

Belongs to: building my own sites