mirror of
https://github.com/andwati/andwati.com.git
synced 2026-10-18 01:12:53 +00:00
8.4 KiB
8.4 KiB
Astro + Strapi Rebuild — TODO
Tracking doc for the astro-migration branch. See the locked spec in the
approved plan for full rationale on each decision referenced below.
Done
- Scaffold pnpm workspace (
apps/siteAstro,apps/cmsStrapi + SQLite) - Switch tooling to pnpm-only, add Biome for lint/format
- Define shared
content/schema (writings, portfolio, bookshelf, blogs) with TOML frontmatter matching the legacy Zola format - Bookshelf schema covers both books (ISBN) and papers (DOI/arXiv id)
- Custom Astro content loader parsing
+++TOML frontmatter directly (no YAML conversion step) - Basic list/detail pages for all four content types, verified running
end-to-end in-browser (
pnpm --filter site dev) - CLAUDE.md updated: no agent self-attribution in commits/PRs, commit regularly after each working step
- Strapi content-type definitions matching the
content/schema exactly (writings, portfolio, bookshelf, blogs) — verified boots and registers all four REST routes apps/cms/Dockerfile.dev+ rootdocker-compose.ymlfor running Strapi locally in a container (node:24-bookworm-slim, matches local Node version);apps/cms/Dockerfileproduction multi-stage build for later Dokploy deployment. Verified: builds, boots, admin panel and API reachable, sharedcontent/volume mounted at the right relative path
Content pipeline
- Strapi custom provider/lifecycle hooks that read + write the same
Markdown files in
content/(Strapi's DB stays a disposable cache) —apps/cms/src/utils/content-{file,sync}.ts, wired insrc/index.ts - Verify round-trip: edit in Strapi admin → file on disk updates, and vice versa, without drift — verified create/update/delete via the content-manager API, plus idempotent re-import across a restart
- Bookshelf ISBN lookup hook with local cover caching —
apps/cms/src/utils/bookshelf-covers.tsfetches from Open Library by ISBN and caches intoapps/site/public/covers/; verified end-to-end (real cover downloaded,cover_imagesynced to file, cleaned up on delete) - Bookshelf paper lookup hook — Semantic Scholar backfills title/authors
by DOI/arXiv id when missing. No cover/thumbnail: neither Semantic
Scholar nor arXiv offers a reliable image source for papers, so
cover_imagestays manually-set for papers (or gets one later from the OG-image pipeline below) - OG image auto-generation extended from the legacy per-post script to
all three content types (writings, portfolio, bookshelf) — blocked
on the design system:
scripts/generate-og-images.mjsis hard-coded to the old "CASE FILE" hacker-terminal branding being fully replaced; building this now would just be redone once the new visual identity lands llms.txtgeneration extended to cover all content types — unblocked oncesite.config.tsexisted (built above for feeds/meta anyway):scripts/generate-llms.astro-site.mjsreads all four content directories directly, wired intoapps/site's build script
Design system
- New typography scale + color system — dark-first (warm near-black,
cream text, coral accent) with a warm-paper light mode;
Fraunces (display/italic) + Newsreader (body) + JetBrains Mono
(nav/meta/code), fluid clamp() type scale.
src/styles/tokens.css. Referenced pixperk.tech and mcyoung.xyz — see the commit for specifics - Motion primitives: CSS + native Web Animations API spring utility —
apps/site/src/lib/spring.ts(damped-oscillator keyframes,prefers-reduced-motionaware). Not wired into any component yet — the Three.js centerpiece below is the natural first user - Base layout/components replacing the placeholder
Base.astro— real header/nav with active-link state, theme toggle, footer with social links. Verified light + dark in-browser across home, a writing detail page (TOC/headings), bookshelf, and 404 - Homepage redesign around the Three.js centerpiece as hero — next up
- New 404 page concept (terminal easter egg retired) — "Page Fault", now fully styled with the rest of the design system
Three.js centerpiece
- Decide the constellation/node-graph data model (what nodes/edges represent — writings ↔ portfolio ↔ beliefs connections)
- Build as an isolated Astro island
- Static image/CSS fallback for
prefers-reduced-motionand low-end devices - Perf budget check on a low-end/mobile profile
Content features carried over from the Zola site
- Series-nav (multi-part post series) —
writings/[...slug].astro, uses the existingextra.series/extra.series_indexfields - Table of contents — inline only, no separate sidebar layout yet (that's
a design-system concern); heading ids +
headingsmetadata now flow throughtoml-content-loader.tssorender(entry)exposes them - Prev/next post navigation
- Related posts (tag-based, tag-overlap ranked, limit 3)
- Per-tag descriptions on tag archive pages —
/tags/+/tags/[tag]/, descriptions ported fromzola.toml's[extra.tag_descriptions] llms_descriptionmeta (site-wide default insite.config.ts+ per-post override, rendered as<meta name="description">inBase.astro)- RSS/JSON feeds —
/rss.xml,/feed.json - Sitemap + robots.txt —
@astrojs/sitemap, staticpublic/robots.txt
Search & comments
- Pagefind integration — indexes the build output (
pnpm buildrunsastro build && pagefind --site dist),/search/page using Pagefind's default UI; verified with a real query in a browser - Webmentions integration (replacing Utterances) — plumbing only:
Base.astrolinksrel="webmention"to a webmention.io endpoint forandwati.com, but nothing displays received mentions yet, and the endpoint won't receive anything until the domain is actually registered/verified on webmention.io (needs your input: create an account, verify domain ownership, then I can build the display side)
Analytics
- Stand up Plausible or Umami on the Dokploy host, wire up tracking snippet (replacing Google Analytics) — needs your input: requires your Dokploy access, not something I can provision from the repo
Migration from the legacy Zola site
- Script/process to convert
content/posts/*.mdinto the newcontent/writings/schema —scripts/migrate-posts-to-writings.mjs, additive only (content/posts/untouched), re-runnable/idempotent. 2 of 20 posts (from-c-to-machine-code,self-hosting-gitea-and-mirroring-github) use note/tip/warning/danger callout shortcodes with no Astro equivalent yet — flagged by the script, needs a real component once the design system exists (not blocking, just noted for later) - Preserve slugs/URLs via redirects — the script generates 301s from
/posts/<slug>/to/writings/<slug>/intosws.toml, idempotently - Migrate
content/archive/,content/about.mdequivalents — holding off: the Astro site doesn't have archive/about pages built yet, and "about" copy/framing is exactly the kind of thing you'd want to review/rewrite for the new "digital legacy" identity, not port as-is - Verify RSS subscribers and inbound links survive the cutover — can only really be checked once this is deployed live (needs your input: this is a production-cutover verification, not a build-time one)
Infra / deployment
- Wire Strapi into the Dokploy deployment alongside the Astro build — needs your input: requires your Dokploy access
- Decide build trigger: webhook on Strapi publish → CI rebuild, vs. manual/scheduled rebuild — needs your input: your call, not an engineering constraint either way
- Update
Dockerfile/sws.tomlfor the new build output (currently Zola-specific) — holding off until the migration/cutover is actually ready to ship, so this doesn't drift out of sync in the meantime
Cleanup
- Remove Zola-specific files (
zola.toml,templates/,sass/,themes/,content/posts/, legacy OG/llms scripts) once each has a working Astro/Strapi equivalent — progressively, not all at once