fix(doc): load the head script of torb doc pages from theme.js #483
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/235-theme-js"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #235
What changed
torb docwrites the head script (headScript, unchanged) astheme.jsat the root of the site (siteFilesincompiler/src/reference/site.trb).<script src="{root}theme.js"></script>instead of an inline<script>, withoutdeferso it still runs before paint, ahead of the deferredsearch-index.jsandsearch.js. No page carries an inline script any more, so the registry'sscript-src 'self'no longer blocks the theme restore.docs/tooling/torb-doc.md(and its generated skill copy) namestheme.js; the comment of the/docs/location intools/deploy/nginx.confno longer says the theme script is blocked.torb docs site) keeps its inline head script (out of scope, not served under a strict CSP).Tests
compiler/tests/reference.test.trb: file list now containstheme.js;theme.jsequalsheadScriptand no page contains an inline<script>; the tag per page depth (index.html,<package>/index.html,<package>/<module>.html) and its order beforesearch-index.jsandsearch.js, withoutdefer.Seed: none (no syntax change, no new native, no driver flag, no std name looked up by string).
21395f9c7f12aa2b83b5CI red on
12aa2b8: ci / tier A (linux-x64) -format --checkfails:./compiler/tests/reference.test.trbwould be reformatted (1 of 1496 files). Runtorb fmton that file and push. No other blockers seen in the diff.Approved at
39a97e9.theme.js == headScript, no inline<script>in any page, tag per page depth and order (theme.js before the deferred search-index.js/search.js, nodefer), file count 9. CI green on this head (tier A/B, bootstrap, pdisc, gates); the earlier fmt failure on12aa2b8is fixed..replace("\n", "")is safe for a file; the script still runs before first paint. The docs site (torb docs site) is untouched, as stated. No consumer undertools/filters the site's file list.script-src 'self'holds; no new external requests.torb-doc.mdand its skill copy listtheme.js; the nginx comment is corrected.Non-blocking: none.