diff --git a/website/.claude/CLAUDE.md b/website/.claude/CLAUDE.md index 45a4a91d9d..4885ed69cc 100644 --- a/website/.claude/CLAUDE.md +++ b/website/.claude/CLAUDE.md @@ -239,7 +239,26 @@ The build script enforces several rules and will throw errors for: - Missing required meta tags per content type ## Creating new pages -Use `sails generate page /` — scaffolds controller, view, page script, and LESS file. Then: add the route in `config/routes.js`, add the LESS `@import` to `importer.less`, and update `config/policies.js` if bypassing `is-logged-in` (not needed under folders like `landing-pages/` that already bypass it). + +**Always use `sails generate page ` or `sails generate page /` — don't hand-create the controller/view/script/LESS files.** The generator produces the correct Actions2 shape, view path, and locals boilerplate; manual scaffolding is error-prone (wrong exits, missing `exposeLocalsToBrowser()` footer, etc.). + +The generator creates four files. For root-level pages, use `` paths; for nested pages, include the `/` segment: +- `api/controllers/view-.js` or `api/controllers//view-.js` +- `views/pages/.ejs` or `views/pages//.ejs` +- `assets/js/pages/.page.js` or `assets/js/pages//.page.js` +- `assets/styles/pages/.less` or `assets/styles/pages//.less` + +### After running the generator +1. Add the route in `config/routes.js` with `pageTitleForMeta` and `pageDescriptionForMeta` under `locals`. +2. Add the matching import to `assets/styles/importer.less`: `@import 'pages/.less';` for root-level pages or `@import 'pages//.less';` for nested pages. +3. If the page needs to bypass `is-logged-in`, update `config/policies.js` (not needed under folders already bypassing it, e.g. `landing-pages/`). +4. Re-lift the dev server — backend changes don't hot-reload. + +### Reuse existing styles, layout, and elements +New pages should mirror the structure and styling of existing landing pages rather than inventing new patterns. Before writing markup or LESS, open 1–2 existing landing pages in `views/pages/landing-pages/` (e.g. `linux-management.ejs`, `replace-jamf.ejs`) and their paired stylesheets in `assets/styles/pages/landing-pages/`, and copy the section scaffolding — hero, feature rows, ``, `bottom-gradient`, `` footer — along with the `[purpose='...']` naming conventions. Reuse existing components (``, ``, ``, video modal pattern) instead of building one-off equivalents. Only introduce new `[purpose]` blocks or LESS variables when nothing existing fits. + +### Deprecated +Do **not** use `sails generate landing-page` (the custom generator under `website/generators/landing-page/`). It's deprecated; use `sails generate page` for landing pages too. ## Code style