Unit 5: fix double <head> in baseof + consolidate theme-init script#7
Open
stradichenko wants to merge 1 commit intomainfrom
Open
Unit 5: fix double <head> in baseof + consolidate theme-init script#7stradichenko wants to merge 1 commit intomainfrom
stradichenko wants to merge 1 commit intomainfrom
Conversation
- baseof.html owns <head>...</head>; partials/head/* now emit children only. - Drop the inline theme-init <script> from baseof.html. critical-css.html injects assets/js/critical.js via safeJS, so that's the single source. - Externalize the in-template main.css resource pipeline; head/styles.html is the owner. - Move the mermaid module loader into a tiny partials/head/mermaid.html, gated on .Store.Get "hasMermaid". - Move the inline math-reprocess script into assets/js/math-init.js. (Unit 11 wires KaTeX; this just stops baseof from inlining it.) - assets/js/critical.js is the single source of truth for the theme-init logic. Duplicated inline copies in head/critical-css.html and head/js.html are removed in Unit 6.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<head>opening:baseof.htmlowns<head>...</head>, andpartials/head/*partials now emit children only.<script>frombaseof.html.head/critical-css.htmlinjectsassets/js/critical.jsviasafeJS, so that's the single source.head/styles.html). Move the mermaid module loader intopartials/head/mermaid.htmlgated on.Store.Get "hasMermaid". Move the inline math-reprocess script intoassets/js/math-init.js.head/critical-css.htmlandhead/js.htmlare removed in Unit 6.Notes for reviewer
baseof.html: Unit 11 removes the{{ partial "math.html" . }}block sincemath.htmlis deleted. Resolve by taking Unit 11's deletion (KaTeX-only).Test plan
<head>opening tag.data-themeis set before first paint.<head>...</head>is well-formed in all generated pages.Part of the PKB-theme modernization batch (15 units).