Skip to content

Unit 8: header refactor — extract modal JS + replace api.qrserver.com with images.QR#10

Open
stradichenko wants to merge 1 commit intomainfrom
unit-08-header-refactor
Open

Unit 8: header refactor — extract modal JS + replace api.qrserver.com with images.QR#10
stradichenko wants to merge 1 commit intomainfrom
unit-08-header-refactor

Conversation

@stradichenko
Copy link
Copy Markdown
Owner

Summary

  • Extract the inline <script> block (~90 LOC: share modal + mobile search) from header.html into assets/js/header-modal.js, bundled with js.Build | minify | fingerprint and SRI.
  • Replace the external <img src="https://api.qrserver.com/..."> with Hugo's images.QR (available since 0.122; theme floor is 0.136).
  • Add defer to all header <script> tags.
  • Wrap stable subtrees in partialCached (menu doesn't depend on per-page state, key on .Site).
  • i18n Search / Share / ToggleTheme strings with English fallback. Replace inline social SVGs with calls to the shared partials/icons.html (Unit 7).

Notes for reviewer

  • ⚠️ Conflicts with Unit 14 on header.html: Unit 14 moves static/img/logo.svgassets/img/logo.svg and updates the logo block.

Test plan

  • No api.qrserver.com reference in built HTML.
  • Header HTML loads header-modal.js with fingerprint + SRI.
  • Share modal opens (or the JS file resolves 200, if e2e click is unavailable).

Part of the PKB-theme modernization batch (15 units).

- Extract the inline <script> block (~90 LOC: share modal + mobile search)
  from header.html into assets/js/header-modal.js, bundled with
  js.Build | minify | fingerprint and SRI.
- Replace the external <img src="https://api.qrserver.com/..."> with
  Hugo's images.QR (available since 0.122; theme floor is 0.136).
- Add defer to all header <script> tags.
- Wrap stable subtrees in partialCached (menu doesn't depend on
  per-page state, key on .Site).
- i18n Search / Share / ToggleTheme strings with English fallback.
- Replace inline social SVGs with calls to the shared
  partials/icons.html (Unit 7).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant