Skip to content

Migrate site from Preact SPA to Astro static site#39

Merged
JoshDFN merged 1 commit intomainfrom
astro-migration
Feb 27, 2026
Merged

Migrate site from Preact SPA to Astro static site#39
JoshDFN merged 1 commit intomainfrom
astro-migration

Conversation

@JoshDFN
Copy link
Copy Markdown
Collaborator

@JoshDFN JoshDFN commented Feb 27, 2026

Summary

  • Replace the single-page Preact + Vite app with Astro for static site generation
  • Every page is now pre-rendered as static HTML at build time — zero JS by default
  • Interactive features (search, filters, copy buttons, theme toggle) use lightweight Preact islands (~18kb gzip total)
  • No changes to skill files, validation, or contributor workflow

What changed

Removed: index.html, vite.config.js, src/app.jsx, src/main.jsx (the entire SPA)

Added:

  • astro.config.mjs — Astro configuration with Preact + sitemap integrations
  • src/pages/ — Separate pages with real URLs (/, /how-it-works/, /api/, /skills/{id}/)
  • src/layouts/ — Shared BaseLayout (meta/SEO) and SiteLayout (header/nav/footer)
  • src/components/ — Preact islands for interactive parts (BrowseTab, ApiTab, SkillHeader, etc.)
  • src/data/skills.ts — Build-time skill loader (reads skills/*/SKILL.md directly)
  • src/data/site.ts — Central site URL/base path config (change 2 lines to migrate domain)
  • Per-skill .md endpoints at /skills/{id}.md with text/markdown content type
  • Custom 404 page

Updated: package.json (Astro deps), README.md (tech stack, new features), CLAUDE.md (project structure), .gitignore, robots.txt

New features

  • Per-skill SEO: unique <title>, <meta>, Open Graph, JSON-LD TechArticle schema, canonical URLs
  • Raw markdown endpoints: /skills/ckbtc.md serves the SKILL.md with proper content type
  • Auto-generated sitemap via @astrojs/sitemap
  • Framework SVG icons with light-mode color adaptation
  • Glow orbs on skill detail pages

What didn't change

  • skills/*/SKILL.md — untouched
  • scripts/ — all validation and generation scripts unchanged
  • .github/workflows/deploy.yml — still runs npm run build, still deploys dist/ to GitHub Pages
  • Contributor workflow — still just edit SKILL.md, run npm run validate && npm run generate

Build

npm run build  →  17 pages in ~1.3s

Test plan

  • npm run build succeeds
  • All 13 skill pages render correctly at /skills/{id}/
  • Navigation between pages works (browse, how-it-works, api)
  • Search and category filters work on browse page
  • GitHub Pages deploy succeeds
  • Mobile responsive at 768px, 640px, 480px, 360px breakpoints
  • Light/dark theme toggle works
  • llms.txt, llms-full.txt, .well-known/agent.json all generate correctly

Generated with Claude Code

Replace the single-page Preact app with Astro for static site generation.
Every page is now pre-rendered at build time with zero JS by default.
Interactive features (search, filters, copy, theme toggle) use Preact islands.

New features:
- Separate pages with real URLs: /, /how-it-works/, /api/, /skills/{id}/
- Per-skill SEO: unique meta tags, JSON-LD TechArticle schema, canonical URLs
- Raw markdown endpoints at /skills/{id}.md (text/markdown content type)
- Auto-generated sitemap via @astrojs/sitemap
- 404 page
- Framework SVG icons with light-mode color support

Build: npm run build still works — validate + generate + astro build.
Deploy workflow unchanged — still outputs to dist/ for GitHub Pages.
Contributors only touch SKILL.md files, everything else is automatic.

17 pages built in ~1.3s. ~18kb gzipped JS total.
@JoshDFN JoshDFN requested a review from marc0olo as a code owner February 27, 2026 10:23
@JoshDFN JoshDFN merged commit d5342a8 into main Feb 27, 2026
6 checks passed
marc0olo added a commit that referenced this pull request Feb 27, 2026
Resolve merge conflicts with Astro migration (PR #39) and apply the
fake API removal to the new Astro codebase:

- Delete ApiTab component and /api/ page entirely
- Remove API_ENDPOINTS constant and API tab from navigation
- Replace "Your Agent / REST API" framework with "skills.sh / npx skills add"
- Update hero, how-it-works terminal example, and CTA to reference
  real access methods (llms.txt, raw GitHub URLs, skills.sh CLI)
- Update footer copy
- Keep both README additions (skill page URLs from Astro + CLI row)
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.

1 participant