fix: serve Swiper and Plotly from local vendor files instead of CDN#341
Merged
Conversation
Replaces three CDN links in main.html (cdn.jsdelivr.net/swiper@11 and
cdn.plot.ly/plotly-3.0.1) with versioned local static paths so the app
works fully offline after initial installation.
- main.html: swap CDN hrefs for static_url('vendor/…') references
- scripts/download-vendor.py: one-shot script that downloads the three
files (swiper-bundle.min.css, swiper-bundle.min.js, plotly.min.js) into
photomap/frontend/static/vendor/ so they are bundled with the pip package
- Makefile: add `make vendor` target that runs the download script
- photomap_server.py: log an actionable error on startup if any vendor
file is missing, rather than silently falling back to a CDN that may
be unreachable
- .gitignore: track scripts/download-vendor.py (scripts/* was excluded)
NOTE: after merging this PR, run `make vendor` from the repo root and
commit the generated files in photomap/frontend/static/vendor/ before
publishing the next release.
Closes #339
Fixes #111
Co-authored-by: Lincoln Stein <lstein@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #339 (and the original #111)
Replaces three CDN links in main.html with versioned local static paths so the app works fully offline after installation.
After merging: run
make vendorand commit the generatedstatic/vendor/files before publishing the next release.Generated with Claude Code