news-digest: cache-bust style.css + app.js with generated_at timestamp

Browsers were serving stale frontend assets after rebuilds, which hid
the new world/local headline desks: the OLD app.js's refreshCounts()
only counted .item children (not .headline), so the new headline desks
came up with visibleItems=0 and got the .is-empty class which is
display:none. Hard refresh fixed it but only for the user who knew
to do that.

Append ?v=<generated_at strftime> to both link/script tags in
digest.html.j2 and archive.html.j2 so every digest run produces a new
asset URL. Works with the existing entrypoint.sh static-asset sync —
no other infra needed.
This commit is contained in:
2026-04-28 11:20:43 -07:00
parent 9bdb41ea6a
commit 018122648f
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Daily Digest · Archive</title>
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="style.css?v={{ generated_at.strftime('%Y%m%d%H%M%S') }}" />
</head>
<body>
<header class="masthead" role="banner">
+6 -2
View File
@@ -5,7 +5,11 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Daily Digest · {{ date_long }} · {{ edition_short }}</title>
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<link rel="stylesheet" href="style.css" />
{# Cache-bust on every digest run so frontend asset updates land
immediately — browsers were serving stale app.js / style.css after
rebuilds, which was hiding headline desks (old JS treated them as
empty because it only counted .item, not .headline). #}
<link rel="stylesheet" href="style.css?v={{ generated_at.strftime('%Y%m%d%H%M%S') }}" />
</head>
<body>
{# ────── header ────── #}
@@ -282,6 +286,6 @@
</div>
</div>
</footer>
<script src="app.js" defer></script>
<script src="app.js?v={{ generated_at.strftime('%Y%m%d%H%M%S') }}" defer></script>
</body>
</html>