vinooganesh opened a new pull request, #165: URL: https://github.com/apache/parquet-site/pull/165
Closes #163 The production site at parquet.apache.org is served behind Apache's Content Security Policy, which blocks resources from external CDNs. This causes broken styling, `jQuery is not defined` errors, and completely non-functional search on the live site, even though everything works fine in local dev. This PR eliminates all external resource dependencies so the site works identically in both environments. ### What was broken | Blocked resource | Effect on production site | |---|---| | `code.jquery.com/jquery-3.7.1.min.js` | `jQuery is not defined` — breaks all JS functionality | | `fonts.googleapis.com/css?family=Open+Sans` | Font fails to load, falls back unpredictably | | `cdn.jsdelivr.net/npm/@docsearch/[email protected]` | Search styling missing | | `cdn.jsdelivr.net/npm/@docsearch/[email protected]` | `docsearch is not defined` — search completely broken | ### What this PR does **Vendor jQuery locally** (originally @alamb 's idea, h/t to him) - Downloaded `jquery-3.7.1.min.js` to `static/js/` and created a project-level override of Docsy's `head.html` partial to load it from there instead of the CDN. Same version, just self-hosted. **Replace Algolia DocSearch with Lunr offline search** - Algolia was doubly broken: blocked by CSP *and* the API keys were removed in a prior commit. Switched to Docsy's built-in Lunr search which is fully client-side with no external dependencies. Also bumped max results to 25 and excerpt length to 200 chars for better usability. **Disable Google Fonts** - Set `$td-enable-google-fonts: false` so the site uses Bootstrap's system font stack instead of trying to fetch Open Sans from Google. Fonts render immediately with no network request. ### Files changed - `hugo.toml` - Enable offline search, remove Algolia config - `assets/scss/_variables_project.scss` - Disable Google Fonts - `layouts/partials/head.html` (new) - Override Docsy's head to load jQuery and Lunr locally - `layouts/partials/scripts.html` (new) - Override Docsy's scripts to remove Algolia JS - `layouts/partials/hooks/head-end.html` - Remove Algolia CSS hook - `layouts/partials/hooks/body-end.html` - Remove Algolia JS hook - `static/js/jquery-3.7.1.min.js` (new) - Vendored jQuery - `static/js/lunr-2.3.9.min.js` (new) - Vendored Lunr ### How I verified Andrew mentioned he wanted to make sure dev matched prod - I built the site from the clean production branch (before) and confirmed all 4 external CDN references are present. Built again with these changes (after) and confirmed zero external resource loads remain. The dev server serves all JS, CSS, and the search index locally, and search returns results. Also, no Docsy version changes here, stays on v0.12.0. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
