From 07bcb288ad616b124189c5e1c092b6662fb12d51 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 1 Jul 2026 10:59:28 +0000 Subject: [PATCH] Restructure static assets and consolidate docs - Move CSS, JS, and images under assets/ (css/, js/, images/) - Remove wave.php and wave2.php; keep legacy redirects in .htaccess - Merge NOTICE into LICENSE attributions section - Remove og-image assets and og:image meta tags - Update README, CHANGELOG, and deploy smoke tests for new paths Co-authored-by: Adam Simms --- .github/workflows/deploy.yml | 12 +- .htaccess | 1 + CHANGELOG.md | 67 ++++----- LICENSE | 17 +++ NOTICE | 19 --- README.md | 135 +++++++++---------- waves.css => assets/css/waves.css | 0 favicon.svg => assets/images/favicon.svg | 0 shared.js => assets/js/shared.js | 0 simulation.js => assets/js/simulation.js | 0 station-poll.js => assets/js/station-poll.js | 0 waves.js => assets/js/waves.js | 0 index.php | 19 ++- lib/layout.php | 1 + og-image.png | Bin 1310413 -> 0 bytes og-image.svg | 13 -- wave.php | 6 - wave2.php | 6 - 18 files changed, 132 insertions(+), 164 deletions(-) delete mode 100644 NOTICE rename waves.css => assets/css/waves.css (100%) rename favicon.svg => assets/images/favicon.svg (100%) rename shared.js => assets/js/shared.js (100%) rename simulation.js => assets/js/simulation.js (100%) rename station-poll.js => assets/js/station-poll.js (100%) rename waves.js => assets/js/waves.js (100%) delete mode 100644 og-image.png delete mode 100644 og-image.svg delete mode 100644 wave.php delete mode 100644 wave2.php diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4c49832..fe85b50 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -119,10 +119,16 @@ jobs: ssh -i ~/.ssh/deploy_key -o BatchMode=yes -p 22 "${user}@${host}" \ "mkdir -p '${server_dir}/cache' && chmod 775 '${server_dir}/cache'" - - name: Smoke test call-api.php + - name: Smoke test production if: ${{ github.event_name != 'workflow_dispatch' || inputs.dry_run != true }} run: | set -euo pipefail - curl -fsS "https://www.pinchards.is/waves/call-api.php" | python3 -c "import json,sys; data=json.load(sys.stdin); assert 'wind' in data" - curl -fsS "https://www.pinchards.is/waves/health.php" | python3 -c "import json,sys; data=json.load(sys.stdin); assert 'status' in data" + base="https://www.pinchards.is/waves" + curl -fsS "${base}/call-api.php" | python3 -c "import json,sys; data=json.load(sys.stdin); assert 'wind' in data" + curl -fsS "${base}/health.php" | python3 -c "import json,sys; data=json.load(sys.stdin); assert 'status' in data" + curl -fsS -o /dev/null "${base}/assets/css/waves.css" + curl -fsS -o /dev/null "${base}/assets/js/waves.js" + curl -fsS -o /dev/null "${base}/assets/images/favicon.svg" + code="$(curl -fsS -o /dev/null -w '%{http_code}' "${base}/wave.php")" + test "${code}" = "301" -o "${code}" = "200" echo "Smoke tests passed." diff --git a/.htaccess b/.htaccess index 4905aed..f7cd8d4 100644 --- a/.htaccess +++ b/.htaccess @@ -1,5 +1,6 @@ RewriteEngine On +# Legacy entry points (wave.php / wave2.php removed; index.php handles all layouts) RewriteRule ^wave\.php$ ?layout=wide [R=301,L,QSA] RewriteRule ^wave2\.php$ ?layout=wide&station=0 [R=301,L,QSA] diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e63007..fbe6269 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,56 +3,47 @@ ## Unreleased ### Added -- `og-image.png` for social link previews -- PHP lint + PHPUnit workflow (`.github/workflows/php.yml`) -- `health.php` monitoring endpoint -- Scheduled production uptime checks (`.github/workflows/uptime.yml`) -- Keyboard orbit controls (arrow keys) -- PHPUnit coverage for `lib/erddap.php` -- Content-Security-Policy header in `.htaccess` -- `wave_period` exposed in API JSON and station readout +- `assets/` tree: `assets/css/`, `assets/js/`, `assets/images/` +- Deploy smoke tests for static asset URLs ### Changed -- Station panel labels: **Wave period** (seconds) and **Wave height** (metres) -- Google Fonts loaded via CSS2 API (`fonts.googleapis.com/css2`) -- Open Graph / Twitter images point to `og-image.png` +- Static files moved out of the site root into `assets/` +- `NOTICE` merged into `LICENSE` (Attributions section) +- README documents project layout and legacy URL handling +- Twitter Card uses `summary` (no social preview image for now) + +### Removed +- `wave.php` and `wave2.php` (legacy URLs redirect via `.htaccess` only) +- `og-image.png`, `og-image.svg`, and Open Graph image meta tags +- Standalone `NOTICE` file + +## 2026-07-01 — Pass 3 + +### Added +- PHP lint + PHPUnit CI, `health.php`, uptime workflow +- Keyboard orbit, CSP header, `wave_period` in API JSON + +### Changed +- Station labels: wave period (s), wave height (m) +- Google Fonts via CSS2 API ## 2026-07-01 — Pass 2 ### Added -- Named ERDDAP column parsing via `columnNames` -- Wind direction support (`wind_dir_avg` → `wind_x` / `wind_y`) -- ERDDAP cache lock to prevent upstream stampedes -- `robots.txt`, `sitemap.xml`, `favicon.svg`, and `og-image.svg` -- `.htaccess` legacy redirects and static asset cache headers -- Touch orbit controls and `prefers-reduced-motion` handling -- Shader compile/link error reporting -- Deploy workflow cache permissions step and `call-api.php` smoke test +- Named ERDDAP columns, wind direction, cache lock +- `robots.txt`, `sitemap.xml`, `favicon.svg`, `.htaccess` redirects +- Touch controls, shader error reporting, deploy hardening ### Changed -- Canonical URLs no longer include `index.php` -- Wide layout CSS no longer overridden by `waves.js` resize inline styles -- `layout-immersive` renamed to `layout-wide-cinematic` -- Station boot config consolidated into `window.STATION` -- Deploy workflow renamed from "Deploy SFTP" to "Deploy" +- Canonical URLs, wide layout fix, `window.STATION`, `layout-wide-cinematic` ### Removed -- Unused vector helpers from `shared.js` -- Redundant `hidden` attribute on the station panel (CSS `station-hidden` only) -- Legacy orbit mode state (`NONE` / `ORBITING`) - -### Fixed -- Wide layout canvas positioning -- `