Upgrade Docsy theme from v0.12.0 to v0.14.2#170
Upgrade Docsy theme from v0.12.0 to v0.14.2#170vinooganesh wants to merge 3 commits intoapache:productionfrom
Conversation
Apache's Content Security Policy on parquet.apache.org blocks scripts from external CDNs. Docsy loads jQuery from code.jquery.com and Lunr from unpkg.com, both of which get blocked, breaking all JS on the production site. This vendors both libraries in static/js/ and overrides Docsy's head.html to load them from the site itself. Same versions, just self-hosted. jQuery is still needed — Docsy's base.js and offline-search.js both depend on it (see google/docsy#1436 for their effort to drop it). Part of apache#163
Upgrades the Docsy theme to v0.14.2 and fixes the visual regressions that come with it: - Bump Docsy from v0.12.0 to v0.14.2 in go.mod - Bump Hugo minimum version to 0.155.3 in hugo.toml and deploy.yml - Fix navbar turning white by setting $td-navbar-bg-color to $primary - Make navbar transparent on cover pages so it blends with the hero image - Switch Releases button from btn-secondary to btn-outline-light - Add navbar_theme = "dark" for proper light text on the blue navbar - Delete outdated navbar.html override (incompatible with v0.14.2) - Delete empty hook partials (head-end.html, body-end.html) - Remove deprecated [blackfriday] config section - Update head.html and scripts.html overrides to match v0.14.2 (dark mode support, scrollspy patch, updated KaTeX handling) while keeping CSP-compliant local jQuery/Lunr loading
|
@vinooganesh this PR has a "WIP" in its title but is not marked as a draft. Is it ready for review? |
|
Also, what do you think about vendoring the theme? As we continue to add overrides to the partials it seems like it would be easier to understand what we have changed 🤔 |
|
Hey @alamb - it wasn't at the time, but now I think it's ready to go. I'll update the title! Docsy's docs actually recommend going with the hugo go module approach. I'm a little more concerned with vendoring docsy then I am about vendoring lunr and jquery mostly because docsy is a pretty active project. I can imagine upgrading eventually resulting in a huge number of diffs making the CR of actual content more difficult (also I've seen projects that vendor other large repos just decided to never update the dependency because over time it becomes a maintenance pain). I think the biggest question is how flexible and customizable we want the website to be. I originally chose docsy as just a simple theme that we could pretty easily use/follow that "looked" like other projects (Iceberg was first and I mirrored their setup). If we want a lot more flexibility outside of what docsy provides then I think it's definitely something worth discussing. |
1cc91be to
3c13c12
Compare
My biggest concern is that it will actually be even harder to upgrade to new docsy versions due to our copy/paste/modify overrides of the partial templates. Right now to update docsy and not lose the changes in our overrides we'l have to know how to:
I am not sure others would even know that we needed to do 2 and so it would be easy to forget |
Upgrades the Docsy theme to v0.14.2 and fixes the visual regressions that came with it:
Bump Docsy from v0.12.0 to v0.14.2 in go.mod
Bump Hugo minimum version to 0.155.3 in hugo.toml and deploy.yml
Fix navbar turning white by setting $td-navbar-bg-color to $primary
Make navbar transparent on cover pages so it blends with the hero image
Switch Releases button from btn-secondary to btn-outline-light
Add navbar_theme = "dark" for proper light text on the blue navbar
Delete outdated navbar.html override (incompatible with v0.14.2)
Delete empty hook partials (head-end.html, body-end.html)
Remove deprecated [blackfriday] config section
Update head.html and scripts.html overrides to match v0.14.2 (dark mode support, scrollspy patch, updated KaTeX handling) while keeping CSP-compliant local jQuery/Lunr loading
Related to Consider vendoring the entire docsy template #164