From 02564bfde74935f1bcd9d922be491d60b6408bd8 Mon Sep 17 00:00:00 2001 From: primal Date: Sun, 1 Feb 2026 17:58:55 -0500 Subject: [PATCH] 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 --- .launch.sh | 15 +++++++++++++++ templates.go | 6 +++--- 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100755 .launch.sh diff --git a/.launch.sh b/.launch.sh new file mode 100755 index 0000000..74f89c3 --- /dev/null +++ b/.launch.sh @@ -0,0 +1,15 @@ +#!/bin/bash +cd "$(dirname "$0")" + +# Increment version number in templates.go +VERSION=$(grep -oE 'v[0-9]+' 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 "$@" diff --git a/templates.go b/templates.go index 60a8b1c..19454e1 100644 --- a/templates.go +++ b/templates.go @@ -445,8 +445,8 @@ const dashboardHTML = ` 1440.news Feed Crawler - - + +
@@ -547,7 +547,7 @@ const dashboardHTML = `
-
v213
+
v220
Last updated: {{.UpdatedAt.Format "2006-01-02 15:04:05"}}