Fix CSS/JS cache busting - sync versions on launch

.launch.sh now updates CSS and JS query params to match app version.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
primal
2026-02-01 17:58:55 -05:00
parent 3a28518366
commit 02564bfde7
2 changed files with 18 additions and 3 deletions
Executable
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
cd "$(dirname "$0")"
# Increment version number in templates.go
VERSION=$(grep -oE 'v[0-9]+</div>' templates.go | grep -oE '[0-9]+')
NEW_VERSION=$((VERSION + 1))
sed -i '' "s/v${VERSION}<\\/div>/v${NEW_VERSION}<\\/div>/" templates.go
# Update CSS and JS cache-busting versions
sed -i '' "s/dashboard\\.css?v=[0-9]*/dashboard.css?v=${NEW_VERSION}/" templates.go
sed -i '' "s/dashboard\\.js?v=[0-9]*/dashboard.js?v=${NEW_VERSION}/" templates.go
echo "Version: v${VERSION} → v${NEW_VERSION}"
~/apps/.launch.sh "$@"
+3 -3
View File
@@ -445,8 +445,8 @@ const dashboardHTML = `<!DOCTYPE html>
<title>1440.news Feed Crawler</title> <title>1440.news Feed Crawler</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/dashboard.css?v=116"> <link rel="stylesheet" href="/static/dashboard.css?v=220">
<script src="/static/dashboard.js?v=120"></script> <script src="/static/dashboard.js?v=220"></script>
</head> </head>
<body> <body>
<div id="topSection"> <div id="topSection">
@@ -547,7 +547,7 @@ const dashboardHTML = `<!DOCTYPE html>
<div id="output"></div> <div id="output"></div>
</div> </div>
<div style="color: #333; font-size: 11px; margin-top: 10px;">v213</div> <div style="color: #333; font-size: 11px; margin-top: 10px;">v220</div>
<div class="updated" id="updatedAt">Last updated: {{.UpdatedAt.Format "2006-01-02 15:04:05"}}</div> <div class="updated" id="updatedAt">Last updated: {{.UpdatedAt.Format "2006-01-02 15:04:05"}}</div>
</body> </body>