Commit a4bc293
committed
fix: remove third-party cdns
The theme and its defaults were pulling several
assets off-origin:
- Zensical 0.0.35 added a GLightbox extension that lazy-loads
glightbox.min.js and glightbox.min.css from unpkg.com whenever
window.GLightbox is undefined (pp() in the theme bundle).
- The theme unconditionally injects a <link> to fonts.googleapis.com
and a preconnect to fonts.gstatic.com when [project.theme].font is
not disabled.
- CI ran `pip install zensical` unpinned, so upgrades like 0.0.34 to
0.0.35 silently introduced new off-origin loads without a review
signal.
Changes:
- Add scripts/vendor_glightbox.py and scripts/vendor_glightbox.toml,
mirroring the existing Mermaid vendoring. The script downloads the
pinned glightbox build from cdn.jsdelivr.net and verifies SHA-256
for both the JS and CSS.
- Vendor glightbox@3.3.1 into docs/assets/javascripts/glightbox.min.js
and docs/assets/stylesheets/glightbox.min.css. Loading the UMD via
extra_javascript defines window.GLightbox before the theme checks
for it, short-circuiting the unpkg fetch. The CSS ships via
extra_css.
- Disable the theme's default Google Fonts by setting `font = false`
in [project.theme]. The site falls back to the system font stack
already wired into the theme CSS.
- Pin zensical==0.0.40 in .github/workflows/docs.yml with a comment
warning reviewers to audit for new unbundled js/css before bumping.
- Extend .gitattributes so docs/assets/stylesheets/** is binary,
symmetric with the existing docs/assets/javascripts/** rule.
- Add a "Verify vendored GLightbox" step to the docs workflow so
drift between the committed files and the pinned SHA-256 values
fails CI.
- Document the new vendored dependency and its upgrade procedure in
CONTRIBUTING.md, next to the existing Mermaid entry.1 parent 032bdb2 commit a4bc293
8 files changed
Lines changed: 355 additions & 24 deletions
File tree
- .github/workflows
- docs/assets
- javascripts
- stylesheets
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
| 28 | + | |
31 | 29 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
| |||
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
54 | | - | |
55 | | - | |
| 61 | + | |
56 | 62 | | |
57 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
58 | 82 | | |
59 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
60 | 87 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
68 | 98 | | |
69 | | - | |
70 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
71 | 118 | | |
72 | 119 | | |
73 | 120 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments