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:
@@ -5,7 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<title>Daily Digest · Archive</title>
|
<title>Daily Digest · Archive</title>
|
||||||
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header class="masthead" role="banner">
|
<header class="masthead" role="banner">
|
||||||
|
|||||||
@@ -5,7 +5,11 @@
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<title>Daily Digest · {{ date_long }} · {{ edition_short }}</title>
|
<title>Daily Digest · {{ date_long }} · {{ edition_short }}</title>
|
||||||
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{# ────── header ────── #}
|
{# ────── header ────── #}
|
||||||
@@ -282,6 +286,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="app.js" defer></script>
|
<script src="app.js?v={{ generated_at.strftime('%Y%m%d%H%M%S') }}" defer></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user