|
1 | 1 | # Askr website |
2 | 2 |
|
3 | | -Static website for the Askr ecosystem, generated with Vite Plus and the Askr CLI, then deployed to GitHub Pages. |
| 3 | +Minimal hydrated Askr static site, generated with Vite Plus and the Askr CLI, |
| 4 | +then deployed to GitHub Pages. |
4 | 5 |
|
5 | 6 | The website consumes published `@askrjs/*` packages from npm. Local builds and |
6 | 7 | CI therefore validate the same package boundary used by GitHub Pages. |
7 | 8 |
|
8 | 9 | ## Commands |
9 | 10 |
|
10 | | -- `npm run build` - full static build into `dist/` |
11 | | -- `npm run generate` - run the Askr static-site generator using the built client template |
12 | | -- `npm run build:incremental` - incremental static generation build |
13 | | -- `npm run verify:static` - validate generated document output |
14 | | -- `npm run preview` - run a local production preview |
15 | | -- `npm run typecheck` - TypeScript validation |
16 | | -- `npm run lint` - lint project files |
17 | | -- `npm run fmt` - format project files |
18 | | -- `npm run check` - lint + typecheck + structure + build + static output verification |
| 11 | +- `npm run dev` starts the Vite development server. |
| 12 | +- `npm run build` builds the client and runs `askr ssg` into `dist/`. |
| 13 | +- `npm run verify:static` validates the generated route, markup, and assets using |
| 14 | + only Node.js built-ins. |
| 15 | +- `npm run preview` serves `dist/` with `vp preview --outDir dist`. |
| 16 | +- `npm run check` runs lint, typecheck, build, and static verification. |
19 | 17 |
|
20 | 18 | ## Architecture |
21 | 19 |
|
22 | | -- `ssg.config.ts`: exports the route registry, document renderer, generation settings, and built assets consumed by `askr ssg` |
23 | | -- `scripts/verify-static-output.ts`: verifies generated document shape, metadata, and assets |
24 | | -- `index.html`: canonical document template for dev and generated output |
25 | | -- `src/pages/_routes.ts`: shared route registry and document metadata lookup |
26 | | -- `src/pages/home/`, `src/pages/framework/`, `src/pages/ui/`, `src/pages/themes/`: top-level route groups with page-owned `_routes` files |
27 | | -- `src/pages/docs/_routes.ts`: docs route group backed by docs-local layout and registry modules |
28 | | -- `src/pages/showcase/_routes.ts`: showcase route group, including nested UI component detail routes |
29 | | -- `src/site/shell/`: body-level site chrome shared by pages |
30 | | -- `src/site/primitives/`: reusable site-level building blocks |
31 | | -- `src/pages/docs/`: docs pages and docs-owned private helpers |
32 | | -- `src/pages/showcase/`: showcase pages plus UI registry, demos, and models |
33 | | -- `src/site/navigation.ts`: cross-site navigation contracts and links |
34 | | -- `src/styles.css`: shared site styles |
35 | | - |
36 | | -### Build Pipeline Notes |
37 | | - |
38 | | -- Dev (`vp dev`) uses `index.html` and mounts `src/app/client.tsx`. |
39 | | -- Client build (`npm run build:client`) builds `index.html`, app JS, CSS, public assets, and the reusable static document template. |
40 | | -- Static generation (`npm run generate`) runs through `askr ssg`, renders shared route handlers, wraps them with the built client template, and atomically publishes routes and assets. |
41 | | -- Incremental generation is available through `npm run generate:incremental`; use `--changed-route`, `--changed-key`, or `--force-full` when the route source supports those signals. |
42 | | -- SSR build (`npm run build:ssr`) compiles `src/app/server/entry-server.tsx`; SSR callers provide the built document template to `renderPage()`. |
43 | | -- Theme boot is centralized in `public/theme-init.js` and loaded by `index.html`. |
44 | | - |
45 | | -## Automation |
46 | | - |
47 | | -- `.github/workflows/ci.yml` only installs the published dependencies, builds the static site, verifies `dist`, and uploads the build artifact. |
48 | | -- `.github/workflows/deploy.yml` builds and verifies the site on `main`, then publishes `dist` through GitHub Pages. |
49 | | - |
50 | | -## Initial Scope |
51 | | - |
52 | | -- Home page |
53 | | -- Showcase landing pages for askr, askr-ui, askr-themes, and askr CLI workflows |
54 | | -- Starter docs pages authored directly in this repository |
| 20 | +- `src/pages/_layout.tsx` owns the root `<main>` shell. |
| 21 | +- `src/pages/_routes.tsx` owns the shared browser/SSG route registry. |
| 22 | +- `src/pages/home.tsx` renders the `/` page. |
| 23 | +- `src/main.tsx` hydrates generated markup and starts the SPA in development. |
| 24 | +- `ssg.config.ts` injects rendered HTML into Vite's built document and publishes |
| 25 | + its hashed assets. |
| 26 | + |
| 27 | +The internal route registry is the only interface shared by the browser and |
| 28 | +SSG. This package does not expose a public API. |
| 29 | + |
| 30 | +## Build and publish flow |
| 31 | + |
| 32 | +1. `npm run build:client` builds the browser entry and stylesheet into |
| 33 | + `.askr/client/` with hashed asset names. |
| 34 | +2. `npm run build:ssg` renders `/`, injects it into the built Vite document, |
| 35 | + and publishes the result to `dist/`. |
| 36 | +3. `npm run verify:static` checks `dist/metadata.json`, pre-rendered content, |
| 37 | + and every referenced asset. |
| 38 | + |
| 39 | +`.github/workflows/deploy.yml` is the only workflow. Pull requests run install |
| 40 | +and all checks without deploying. Pushes to `main` and manual dispatches run the |
| 41 | +same gates, upload `dist/`, and deploy it through the `github-pages` |
| 42 | +environment. |
| 43 | + |
| 44 | +The repository does not carry a `CNAME` file. Configure `askrjs.com` in the |
| 45 | +repository's Pages settings (or through the Pages API), wait for DNS and the |
| 46 | +certificate to become healthy, then enable HTTPS enforcement. |
0 commit comments