Skip to content

Move CSS and JS to src folders - #3277

Merged
enf0rc3 merged 1 commit into
mainfrom
willlaugesen/nes-257-move-css-and-js-to-src-folders
Aug 4, 2026
Merged

enf0rc3 merged 1 commit into
mainfrom
willlaugesen/nes-257-move-css-and-js-to-src-folders

Conversation

@enf0rc3

@enf0rc3 enf0rc3 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Closes NES-257

What

The CDN now serves fresh HTML, so main.css, vars.css and the site JS can live in src/ and be bundled like everything else. Previously they sat in public/ so clients holding HTML cached for up to 7 days could still resolve the original /docs/css/ and /docs/js/ paths.

  • public/docs/css/{main,vars}.css → src/styles/
  • public/docs/js/** → src/scripts/ (joins the existing theme-switcher.ts)
  • Imports updated in HtmlHead.astro, Search.astro, src/layouts/Default.astro and src/themes/octopus/layouts/{Default,Search}.astro
  • package.json prettier scripts: dropped the public/docs/js/** and public/docs/css/** globs, since src/** now covers these files. The only CSS left under public/docs/css is the vendored Font Awesome bundle.
  • cspell.json ignore path moved from public/docs/js/** to src/scripts/**

Font Awesome CSS and webfonts stay in public/docs/css/fa — the @font-face rules in vars.css point at them and the webfonts keep their stable, cacheable paths.

public/css/report.css also stays put; the report pages link it by URL rather than importing it.

Single commit, pure renames

Everything is one commit of git mv operations. git show --stat -M shows all 27 moved files with 0 content changes, so other in-flight PRs touching these files rebase cleanly.

Verification

  • pnpm build succeeds (2697 pages)
  • Built pages reference the hashed bundles: /docs/_astro/components.BPDC2879.css, /docs/_astro/Default.astro_...DFIbMPWK.js, plus the dynamic-import chunks (code-blocks, detail-tabs, figures, headers, search-dialog, synonyms, youtube)
  • /docs/css/fa/css/*.css still emitted and linked
  • /docs/css/main.css and /docs/js/ no longer emitted, which is the intent of this change

Note: prettier --check reports pre-existing formatting drift across src/ (including files untouched here), so I did not run --write — that would have buried the renames.

🤖 Generated with Claude Code

The CDN now serves fresh HTML, so the unbundled copies no longer need to
sit in public/ at their original /docs/css/ and /docs/js/ paths.

- public/docs/css/{main,vars}.css -> src/styles/
- public/docs/js/** -> src/scripts/
- Update the imports in HtmlHead, Search and the two Default layouts
- Drop the public/ globs from the prettier scripts (src/** covers them)
- Point the cspell ignore at src/scripts/**

Font Awesome CSS and webfonts stay in public/docs/css/fa so the webfonts
keep their stable, cacheable paths.

Done as pure git mv operations so other in-flight PRs on these files
rebase cleanly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@team-marketing-branch-protections

Copy link
Copy Markdown

Pull request environment is available at https://stoctodocspr3277.z22.web.core.windows.net.

You can view the ephemeral environment status in Octopus Deploy.

This environment will be automatically deprovisioned when the pull request is closed, or after 7 days of inactivity.

@enf0rc3
enf0rc3 marked this pull request as ready for review August 4, 2026 03:50
@enf0rc3
enf0rc3 merged commit f4f8b7f into main Aug 4, 2026
7 checks passed
@enf0rc3
enf0rc3 deleted the willlaugesen/nes-257-move-css-and-js-to-src-folders branch August 4, 2026 20:37
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.

3 participants