Skip to content

Edit existing posts + cover images in /write portal - #11

Merged
HumbleBee14 merged 1 commit into
mainfrom
feature/edit-and-cover
Jul 13, 2026
Merged

Edit existing posts + cover images in /write portal#11
HumbleBee14 merged 1 commit into
mainfrom
feature/edit-and-cover

Conversation

@HumbleBee14

Copy link
Copy Markdown
Member

What

Two features for the /write portal.

Cover image — pick an image already placed in the post or upload a new one, at the bottom of the meta form. Stored once, written to frontmatter as cover: ./x, bundled in the ZIP, used as the social/OG card and rendered as an optional hero atop the post.

Edit an existing post — every export now also writes a hidden .write-source.json sidecar (the exact editor doc + meta + table styles) next to the post. An "Edit a published post" dialog takes the post URL, fetches that sidecar plus the original image bytes from GitHub raw (open CORS, individual files — no repo/folder download), and reloads everything losslessly into the editor. Original publish date is preserved; updated: is stamped on re-export. Missing sidecar → clean error, never corrupts.

Files

  • New: src/write/serialize/source.ts, src/write/serialize/fetchExisting.ts
  • Changed: WritePortal, MetaForm, toMdx, toZip, blog/[slug].astro, global.css, editor-theme.css

Cover: pick an in-post image or upload one; stored once, used as the
social/OG card and an optional post hero.

Edit: each export writes a .write-source.json sidecar next to the post;
'Edit a published post' dialog fetches it plus the original images from
GitHub raw and reloads them losslessly into the editor. Original publish
date preserved, updated date stamped on re-export.
@HumbleBee14
HumbleBee14 merged commit 9d17b37 into main Jul 13, 2026
1 of 2 checks passed
@HumbleBee14
HumbleBee14 deleted the feature/edit-and-cover branch July 13, 2026 07:27
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