Edit existing posts + cover images in /write portal - #11
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two features for the
/writeportal.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.jsonsidecar (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 publishdateis preserved;updated:is stamped on re-export. Missing sidecar → clean error, never corrupts.Files
src/write/serialize/source.ts,src/write/serialize/fetchExisting.tsblog/[slug].astro, global.css, editor-theme.css