Use Unix timestamp for cache busting, remove version display
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+5
-7
@@ -1,15 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
# Increment version number in templates.go
|
# Use Unix timestamp for cache busting
|
||||||
VERSION=$(grep -oE 'v[0-9]+</div>' templates.go | grep -oE '[0-9]+')
|
TS=$(date +%s)
|
||||||
NEW_VERSION=$((VERSION + 1))
|
|
||||||
sed -i '' "s/v${VERSION}<\\/div>/v${NEW_VERSION}<\\/div>/" templates.go
|
|
||||||
|
|
||||||
# Update CSS and JS cache-busting versions
|
# 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\\.css?v=[0-9]*/dashboard.css?v=${TS}/" templates.go
|
||||||
sed -i '' "s/dashboard\\.js?v=[0-9]*/dashboard.js?v=${NEW_VERSION}/" templates.go
|
sed -i '' "s/dashboard\\.js?v=[0-9]*/dashboard.js?v=${TS}/" templates.go
|
||||||
|
|
||||||
echo "Version: v${VERSION} → v${NEW_VERSION}"
|
echo "Cache bust: ${TS}"
|
||||||
|
|
||||||
~/apps/.launch.sh "$@"
|
~/apps/.launch.sh "$@"
|
||||||
|
|||||||
+2
-4
@@ -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=220">
|
<link rel="stylesheet" href="/static/dashboard.css?v=222">
|
||||||
<script src="/static/dashboard.js?v=220"></script>
|
<script src="/static/dashboard.js?v=222"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="topSection">
|
<div id="topSection">
|
||||||
@@ -547,8 +547,6 @@ const dashboardHTML = `<!DOCTYPE html>
|
|||||||
<div id="output"></div>
|
<div id="output"></div>
|
||||||
</div>
|
</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>
|
||||||
</html>`
|
</html>`
|
||||||
|
|||||||
Reference in New Issue
Block a user