# Content Migration: Static HTML to Strapi

## Source files

Current static site at `/usr/local/www/clawdie/`:

| File | Target content type | Notes |
| --- | --- | --- |
| `index.html` | Page (slug: `home`) | Extract sections: hero, what-is, ecosystem, setup, bigger-picture, full-stack, this-server |
| `docs/index.html` | Page (slug: `docs`) | Documentation index |
| `guides/freebsd-setup.html` | Guide | Category: setup |
| `guides/nginx-ssl.html` | Guide | Category: networking |
| `guides/stripe-agents.html` | Guide | Category: integration |
| `guides/tailscale-vpn.html` | Guide | Category: networking |

## Skill pages (auto-generated)

Skills should be synced from `.agent/skills/*/SKILL.md` files at build time,
not manually entered into Strapi. Two approaches:

**Option A: Build-time import** (recommended)
- Astro reads SKILL.md files directly from the repo at build time
- No Strapi dependency for skills
- Skills are always in sync with code

**Option B: Strapi sync script**
- Script reads all SKILL.md files and pushes to Strapi API
- Run after adding/updating skills
- Adds a sync step but keeps all content in one place

Recommended: Option A for skills, Strapi for everything else.

## Migration order

1. Create content types in Strapi (Page, Guide, BlogPost)
2. Migrate guides first — simplest, self-contained HTML
3. Migrate docs index
4. Migrate homepage sections — most complex, has custom layout
5. Verify all API endpoints return correct content
6. Switch Astro to pull from Strapi instead of static files
7. Remove old static HTML once Astro build is verified

## Content extraction approach

For each HTML file:

1. Read the file
2. Extract text content from semantic HTML (h1, h2, p, ul, etc.)
3. Convert to Markdown or Strapi Rich Text format
4. Create entry via Strapi REST API:

```sh
curl -X POST http://192.168.100.3:1337/api/pages \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "data": {
      "title": "Home",
      "slug": "home",
      "content": "..."
    }
  }'
```

## Verification

After migration, verify each content type:

```sh
# list all pages
curl -s http://192.168.100.3:1337/api/pages | python3 -m json.tool

# list all guides
curl -s http://192.168.100.3:1337/api/guides | python3 -m json.tool
```
