-
Notifications
You must be signed in to change notification settings - Fork 1
feat: migrate landing to Astro #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| # RTK Landing — Claude Code Instructions | ||
|
|
||
| ## URLs | ||
|
|
||
| | Environment | URL | | ||
| |-------------|-----| | ||
| | Production | https://www.rtk-ai.app | | ||
| | GitHub Repo | https://github.com/rtk-ai/rtk-landing | | ||
| | RTK Repo | https://github.com/rtk-ai/rtk | | ||
|
|
||
| ## Stack | ||
|
|
||
| Astro 5 + Starlight + CSS custom properties (dark-only). No React, no component framework. | ||
|
|
||
| ## Local dev | ||
|
|
||
| ```bash | ||
| pnpm dev # Quick (stub docs) | ||
| pnpm dev:full # Full (prepare-docs + search + dev) | ||
|
|
||
| # With a specific RTK branch/worktree: | ||
| RTK_REPO_PATH=/Users/florianbruniaux/Sites/rtk-ai/rtk/.worktrees/<branch> pnpm dev:full | ||
| ``` | ||
|
|
||
| ## Build & deploy | ||
|
|
||
| ```bash | ||
| pnpm build # Full production build (prepare-docs + build-search + astro build) | ||
| pnpm preview # Preview dist/ | ||
| ``` | ||
|
|
||
| Push to `main` auto-deploys via GitHub Actions (`.github/workflows/deploy.yml`). | ||
|
|
||
| ## Architecture overview | ||
|
|
||
| ``` | ||
| src/ | ||
| pages/ | ||
| index.astro # Landing page | ||
| vox/index.astro # Vox product page | ||
| icm/index.astro # ICM product page | ||
| rss.xml.ts # RSS feed endpoint | ||
| 404.astro # 404 page | ||
| content/docs/guide/ # GENERATED — do not edit (from prepare-docs.mjs) | ||
| data/ | ||
| rss-entries.ts # ← EDIT THIS to add RSS entries | ||
| docs-search-entries.ts # GENERATED | ||
| docs-anchor-map.json # GENERATED | ||
| search-index.ts # Search entries for landing pages | ||
| components/ | ||
| landing/ # Landing-specific components (Nav, Hero, Footer, etc.) | ||
| global/ # Shared components (Header for docs pages) | ||
| starlight/ # Starlight overrides (Header, Footer) | ||
| styles/ | ||
| global.css # Design tokens + base resets (source of truth) | ||
| landing.css # Landing page styles | ||
| starlight-overrides.css # Starlight theme overrides | ||
| scripts/ | ||
| prepare-docs.mjs # Docs pipeline: rtk/docs/guide/ → src/content/docs/guide/ | ||
| build-search-index.mjs # Builds docs-search-entries.ts from content | ||
| ``` | ||
|
|
||
| ## Design system | ||
|
|
||
| Design tokens are in `src/styles/global.css`. Key vars: | ||
|
|
||
| ```css | ||
| --bg: #060b18 --accent: #00e599 | ||
| --bg-alt: #0c1225 --cyan: #38bdf8 | ||
| --bg-card: #0f1629 --violet: #a78bfa | ||
| --text: #e2e8f0 --border: #1a2344 | ||
| --text-muted: #8294ab | ||
| --text-dim: #64748b | ||
| ``` | ||
|
|
||
| Never add inline styles for colors that have tokens. Never duplicate tokens in landing.css. | ||
|
|
||
| ## Source of truth rules | ||
|
|
||
| | Data | Source | Never edit | | ||
| |------|--------|-----------| | ||
| | Docs content | `rtk/docs/guide/**/*.md` | `src/content/docs/guide/` | | ||
| | Docs search index | Generated by `build-search-index.mjs` | `src/data/docs-search-entries.ts` | | ||
| | Anchor map | Generated by `prepare-docs.mjs` | `src/data/docs-anchor-map.json` | | ||
| | RSS entries | `src/data/rss-entries.ts` | `src/pages/rss.xml.ts` | | ||
|
|
||
| ## After each RTK release | ||
|
|
||
| 1. Update `src/data/rss-entries.ts` — add entry at top of array | ||
| 2. Run `/update-rss` (slash command) or add manually with format: | ||
| ```ts | ||
| { type: 'release', title: 'RTK vX.Y.Z', date: 'Mon D, YYYY', description: '...', link: '...' } | ||
| ``` | ||
|
|
||
| ## Docs pipeline | ||
|
|
||
| The script reads `$RTK_REPO_PATH/docs/guide/**/*.md` recursively and copies to `src/content/docs/guide/` preserving subdirectory structure. Files already have valid Starlight frontmatter. | ||
|
|
||
| CI clones `rtk/main` at `./rtk-repo`. Once `feat-refac-doc` is merged into main, the new nested docs structure will be live automatically. | ||
|
|
||
| ## Nav architecture | ||
|
|
||
| | Page type | Nav component | | ||
| |-----------|--------------| | ||
| | Landing (`/`) | `src/components/landing/Nav.astro` | | ||
| | Product pages (`/vox/`, `/icm/`) | `src/components/landing/ProductNav.astro` | | ||
| | Docs (`/guide/**`) | `src/components/global/Header.astro` (via Starlight override) | | ||
|
|
||
| Anchor links in Nav.astro use absolute paths (`/#problem`, `/#install`) so they work from any page. | ||
|
|
||
| ## Workflow before push to main | ||
|
|
||
| ```bash | ||
| pnpm build # Must pass with 0 errors | ||
| ``` | ||
|
|
||
| Check: no TypeScript errors, all pages generated, RSS endpoint at /rss.xml. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| name: prepare-docs | ||
| description: Regenerate docs content from the RTK repo | ||
| --- | ||
|
|
||
| Regenerate the docs content by running the prepare-docs pipeline. | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Ask which RTK path to use (default: `../rtk`, worktree: prompt for path): | ||
| - Default sibling: `RTK_REPO_PATH=../rtk` | ||
| - Specific worktree: `RTK_REPO_PATH=/Users/florianbruniaux/Sites/rtk-ai/rtk/.worktrees/<branch>` | ||
|
|
||
| 2. Run the script: | ||
| ```bash | ||
| RTK_REPO_PATH=<path> node scripts/prepare-docs.mjs | ||
| ``` | ||
|
|
||
| 3. Report: files copied count, anchor map entries count. | ||
|
|
||
| 4. If file count is 0, diagnose why (path wrong? docs/guide/ missing?). | ||
|
|
||
| 5. Run a quick build to validate: | ||
| ```bash | ||
| pnpm build | ||
| ``` | ||
|
|
||
| 6. Report build status and list of generated doc routes. | ||
|
|
||
| ## Context | ||
|
|
||
| - **Source**: `$RTK_REPO_PATH/docs/guide/**/*.md` (recursive) | ||
| - **Output**: `src/content/docs/guide/` (mirrors source structure) | ||
| - **Anchor map**: `src/data/docs-anchor-map.json` | ||
| - Files already have valid Starlight frontmatter — the script does NOT inject any |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| name: update-rss | ||
| description: Add a new entry to the RSS feed | ||
| --- | ||
|
|
||
| Add a new entry to `src/data/rss-entries.ts`. | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Ask what type of update this is: | ||
| - `release` — new RTK version | ||
| - `new_page` — new product or landing page | ||
| - `new_doc` — new documentation page | ||
| - `new_feature` — significant new feature | ||
| - `performance` — perf improvement worth announcing | ||
|
|
||
| 2. Ask for: title, date (format: "Apr 10, 2026"), description (1-3 sentences, no HTML), link (absolute URL). | ||
|
|
||
| 3. Add the entry at the **top** of the `rssEntries` array in `src/data/rss-entries.ts`. | ||
|
|
||
| 4. Confirm the entry was added correctly (show the first 5 entries). | ||
|
|
||
| ## Rules | ||
|
|
||
| - Entries must be sorted newest first | ||
| - Date format: "Mon D, YYYY" (e.g., "Apr 10, 2026") | ||
| - Description: plain text only, no HTML tags | ||
| - Link: always absolute URL starting with `https://` | ||
| - Never edit `src/pages/rss.xml.ts` — only `src/data/rss-entries.ts` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "hooks": { | ||
| "PostToolUse": [ | ||
| { | ||
| "matcher": "Bash", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "input=$(cat); echo \"$input\" | grep -q 'git push' && printf '\\n⚠️ [RSS] Pushed to landing. New release or content? Update src/data/rss-entries.ts\\n Types: release | new_page | new_doc | new_feature | performance\\n File: /Users/florianbruniaux/Sites/rtk-ai/rtk-landing/src/data/rss-entries.ts\\n' || true" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,75 @@ | ||||||
| name: Deploy to GitHub Pages | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: ["main"] | ||||||
|
||||||
| branches: ["main"] | |
| branches: ["main", "master"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,33 @@ | ||
| .fastembed_cache/ | ||
| # Astro | ||
| dist/ | ||
| .astro/ | ||
|
|
||
| # Dependencies | ||
| node_modules/ | ||
|
|
||
| # IDE | ||
| .idea/ | ||
| .vscode/ | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Environment | ||
| .env | ||
| .env.* | ||
| *.pyc | ||
| __pycache__/ | ||
| .DS_Store | ||
| !.env.example | ||
|
|
||
| # Debug | ||
| npm-debug.log* | ||
| pnpm-debug.log* | ||
|
|
||
| # Generated content (rebuilt at CI time from rtk repo) | ||
| src/content/docs/ | ||
| src/data/docs-anchor-map.json | ||
| src/data/docs-search-entries.ts | ||
|
|
||
| # Next.js (not used here but just in case) | ||
| .next/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hook message hardcodes an absolute local filesystem path (
/Users/.../src/data/rss-entries.ts), which will be incorrect for other contributors and leaks a machine-specific path into the repo. Consider making the message path relative (or omit it) so the hook is portable.