Skip to content

Add Astro blog subproject with local writing admin#1

Open
musepy wants to merge 15 commits into
mainfrom
add-blog-subproject
Open

Add Astro blog subproject with local writing admin#1
musepy wants to merge 15 commits into
mainfrom
add-blog-subproject

Conversation

@musepy

@musepy musepy commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

First commit of the blog subproject (blog.pengxu.work) — an Astro site that has lived uncommitted under blog/ and deploys separately to Cloudflare Pages. Split into two commits:

  1. Add Astro blog subproject with local writing admin — the full blog (35 files) + a new dev-only /admin writing backend + root scaffolding to host the subproject.
  2. Update portfolio project covers — unrelated pre-existing edit to src/lib/projects.ts (genable/anycast cover images), kept as its own commit.

The /admin writing tool

A local-first WYSIWYG backend so posts can be edited in the blog's own render environment instead of raw Markdown:

  • Dev-only by construction — routes are injected only when command === 'dev' (integration.mjs), so they never reach dist/. Verified: production build emits 49 pages with zero admin files or API references.
  • Milkdown Crepe WYSIWYG editor, themed onto the blog's design tokens (dark/light follow the site automatically).
  • Frontmatter as form fields — no hand-editing YAML. Saves write back to src/content/posts/ with byte-format matching existing posts (verified round-trip on the most HTML/symbol-heavy post).
  • ⌘S to save; content-watcher full-reload suppressed so the cursor survives saves.

Root scaffolding

  • .gitignore: exclude blog/{node_modules,dist,.astro} and throwaway QA screenshots.
  • tsconfig.json: exclude blog/ from the root Next.js typecheck.
  • .mcp.json: declare the genable MCP server (no secrets).

Verification

  • Full smoke test through the preview server: list → create → edit → save → confirmed on-disk write (special chars <> & " and Chinese quotes all escape correctly).
  • npx astro build clean; dist/ contains no admin surface.

Note found during testing

llm-capability-wasted.md has an accidental GFM strikethrough live in production (two ~ form a <del> span). Opening it in the new editor surfaces it immediately — fix can ride a later content edit.

🤖 Generated with Claude Code

musepy and others added 15 commits June 11, 2026 15:09
The blog (blog.pengxu.work) lives as an Astro subproject under blog/,
deployed separately to Cloudflare Pages. This is its first commit.

Includes a dev-only writing backend at /admin:
- Routes injected only under `astro dev` (never reach the build/dist),
  so there is zero exposure surface in production.
- Milkdown Crepe WYSIWYG editor themed to the blog's design tokens.
- Frontmatter edited via form fields; saves write back to
  src/content/posts/ with byte-format matching existing posts.

Root scaffolding to host the subproject: .gitignore excludes for
blog/{node_modules,dist,.astro} and throwaway QA screenshots;
tsconfig.json excludes blog/ from the root Next.js typecheck.
.mcp.json declares the genable MCP server.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Point genable cover at cover.png and add anycast cover.png.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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