Skip to content

Commit 239bdea

Browse files
pfeerickclaude
andauthored
feat: add static script gallery with GitHub Pages deployment (#52)
* feat: add static gallery site generator and GitHub Pages deployment Generates a single index.html from scripts.json using Tailwind CSS CDN and Alpine.js for search, category tabs, tag filtering, image carousels, lightbox, and dark/light mode. GitHub Actions workflow deploys to Pages on push to main. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: correct carousel navigation, dark mode, and toggle icons - Wrap carousel and lightbox prev/next buttons in <div class="contents"> so Alpine x-if renders all siblings, not just the first (caused missing forward arrow) - Add tailwind.config darkMode: 'class' so the toggle actually works instead of deferring to OS preference - Replace broken partial sun SVG with Heroicons v2 outline sun and moon, matching the stroke style used throughout the rest of the UI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: remove non-existent screenshot-5 reference from EdgeTX Goodies Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: replace broken external image URL with local screenshots for EdgeTX Goodies Downloads 4 widget screenshots from upstream repo and references them locally, removing the 404 GitHub raw URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: prevent processing of image paths outside the repository root in process_images function * fix: preserve full relative subdirectory structure when processing images * fix: update keydown event listeners to use window scope for better accessibility * fix: ensure safe JSON serialization to prevent script tag conflicts in generated HTML * fix: add rel="noopener noreferrer" to external links for improved security * fix: enhance image slideshow controls with proper timer management * fix: improve JSON serialization to prevent HTML tag conflicts * fix: narrow to OSError in image processing error handling for clearer warnings The broad except Exception works but masks the actual failure mode. Narrowing to OSError (which covers IOError, PermissionError, etc.) would be more precise while still handling all realistic file-copy failures. * fix: ensure safe handling of script tags by checking if tags are an array * fix: remove unused event listener for tag filtering in lightbox * fix: expand .gitignore to include Python-related files and virtual environments --------- Co-authored-by: Peter Feerick <5500713+pfeerick@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b7b3031 commit 239bdea

8 files changed

Lines changed: 699 additions & 1 deletion

File tree

.github/workflows/gh-pages.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy Script Gallery
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'ASSETS/**'
8+
- 'scripts.json'
9+
- 'tools/generate_site.py'
10+
- '.github/workflows/gh-pages.yml'
11+
pull_request:
12+
paths:
13+
- 'ASSETS/**'
14+
- 'scripts.json'
15+
- 'tools/generate_site.py'
16+
- '.github/workflows/gh-pages.yml'
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
pages: write
22+
id-token: write
23+
24+
concurrency:
25+
group: pages
26+
cancel-in-progress: false
27+
28+
jobs:
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v6
33+
- uses: astral-sh/setup-uv@v8.1.0
34+
- name: Generate site
35+
run: uv run tools/generate_site.py --scripts-json scripts.json --assets-dir ASSETS --output-dir site
36+
- name: Upload Pages artifact
37+
if: github.event_name != 'pull_request'
38+
uses: actions/upload-pages-artifact@v3
39+
with:
40+
path: ./site
41+
- name: Upload PR preview artifact
42+
if: github.event_name == 'pull_request'
43+
uses: actions/upload-artifact@v7
44+
with:
45+
name: site-preview-pr-${{ github.event.pull_request.number }}
46+
path: ./site
47+
48+
deploy:
49+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
50+
needs: build
51+
runs-on: ubuntu-latest
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
steps:
56+
- id: deployment
57+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
11
.DS_Store
2+
site/
3+
4+
# Python
5+
__pycache__/
6+
*.py[cod]
7+
*$py.class
8+
9+
# Python virtual environments
10+
.venv/
11+
venv/
12+
env/
13+
ENV/
32.5 KB
Loading
42.5 KB
Loading
48.1 KB
Loading
45.9 KB
Loading

scripts.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,9 @@
382382
"ASSETS/edgetx-goodies/screenshot-1.png",
383383
"ASSETS/edgetx-goodies/screenshot-3.png",
384384
"ASSETS/edgetx-goodies/screenshot-5.png",
385-
"https://github.com/MadMonkey87/EdgeTX-Goodies/raw/main/SCREENSHOTS/screenshot_tx16s_22-08-09_19-54-08.png"
385+
"ASSETS/edgetx-goodies/screenshot-6.png",
386+
"ASSETS/edgetx-goodies/screenshot-7.png",
387+
"ASSETS/edgetx-goodies/screenshot-8.png"
386388
],
387389
"tags": [
388390
"widget",

tools/generate_site.py

Lines changed: 627 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)