diff --git a/.gitignore b/.gitignore index 444527a..e934dac 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,10 @@ public/ _import/ docs/superpowers/ +# synced from node_modules/medium-zoom by scripts/sync-vendor-assets.js +# (see the preantora/preantora-local npm scripts) +ui/supplemental/js/vendor/ + # macOS and IDEs .DS_Store .vscode/ diff --git a/README.md b/README.md index 66d504c..10a0f05 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,10 @@ antora-extensions/ comp-version, latest/next-alias, sitemap-cleanup, globa asciidoc-extensions/ tabs, remote-include global-attributes.yml site-wide AsciiDoc attributes (local) ui/supplemental/ branding + Pagefind modal search on the stock UI +ui/supplemental/js/vendor/ gitignored; synced from node_modules by scripts/sync-vendor-assets.js content/// each version is a folder with its own antora.yml sync/ retired upstream-mirror tooling, kept as provenance +scripts/ build-time helpers (npm `pre*` hooks), e.g. sync-vendor-assets.js .github/workflows/ci.yml build → pagefind → deploy to GitHub Pages ``` diff --git a/extension-tests/static-files.test.js b/extension-tests/static-files.test.js index ad531dd..4ef53f9 100644 --- a/extension-tests/static-files.test.js +++ b/extension-tests/static-files.test.js @@ -213,3 +213,21 @@ test('root static files are not published under the UI output dir', (t) => { // ui.yml is consumed by the UI loader; it must never be published itself. assert.ok(!fs.existsSync(path.join(PUBLIC, 'assets', 'ui.yml')), 'ui.yml leaked into the build output') }) + +test('the medium-zoom vendor bundle synced from node_modules is published', (t) => { + if (!fs.existsSync(path.join(PUBLIC, 'index.html'))) { + t.skip('public/ not built (run `npm run antora` to enable)') + return + } + // ui/supplemental/js/vendor/ is gitignored and repopulated from node_modules by + // scripts/sync-vendor-assets.js (wired as preantora/preantora-local). Every + // page still references js/vendor/medium-zoom.min.js regardless, so a build + // that skips that step (e.g. `npx antora` directly) publishes green with a + // 404'ing +{{!-- Click-to-zoom for images. `defer` on both (not `async`) because the init + script needs the global the vendored library defines, and deferred external + scripts run in document order. --}} + + diff --git a/ui/supplemental/partials/head-styles.hbs b/ui/supplemental/partials/head-styles.hbs index 81a5081..36d97e8 100644 --- a/ui/supplemental/partials/head-styles.hbs +++ b/ui/supplemental/partials/head-styles.hbs @@ -2,3 +2,4 @@ +