Add /write visual article portal - #4
Merged
Merged
Conversation
Deploying mlsystems with
|
| Latest commit: |
0a21ffd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://dca78311.mlsystems.pages.dev |
| Branch Preview URL: | https://feature-write-portal.mlsystems.pages.dev |
…picker; bigger add button
…d (visible in both site themes)
Serializer correctness: - Wrap link destinations containing () or spaces in angle brackets - Emit theme-aware var(--tc-*) for text colors (readable in dark mode) - Escape leading list/blockquote/heading/HR markers in plain text - Add --tc-* text-color custom properties (light + dark) Rendering: - Style article h3 (explicit size) and add h4 so editor's 3 heading levels stay visually distinct; map h4 in MDXComponents Editor/UX: - Parse YouTube v= anywhere in the query, not only watch?v= first - Lock the editor while the restore-draft banner is up so typing is not silently discarded - Keep a custom slug when editing the title after restore - Validate image-by-URL input - Surface packaging errors on download instead of swallowing them Efficiency/cleanup: - persistAssets writes only new/removed blobs instead of clearing all - Memoize KaTeX render in MathBlock - Single COMPONENT_NAME_RE source of truth in validate.ts
- Halve the desktop canvas breakout (48px to 24px) so body text sits close to the Post border instead of floating far inside; trim top pad - Move the restore-draft banner from page top to directly above the Post box, where the writer is looking when a draft loads
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
A no-login, in-browser article editor at
/writeso contributors can write posts without touching MDX, Git, or the repo layout. They write visually; the portal generates the exact post folder the repo expects and hands them a ZIP to drop intosrc/content/posts/(or attach to an issue for a maintainer).How it works
src/write/serialize/toMdx.tsis a pure function turning the editor's block JSON intoindex.mdx, byte-matching the conventions indocs/writing-articles.md(heading levels, hoistedastro:assetsimports, component syntax, escaping). Fully unit-tested (31 cases).<slug>/index.mdx+ images + any component.tsx+ aHOW-TO-SUBMIT.md. A validation checklist (missing title/summary/topic, bad slug, images without alt, empty blocks) gates the download.Scope
src/write/so it can evolve as the blog gains new markdown features (new feature = one block file + one serializer case + one test). Nothing outsidesrc/write/,src/pages/write.astro, theguestauthor, the sitemap skip, and deps changes.$...$/$$...$$), which was already wired in the pipeline but marked "can be enabled" in the docs.guestdefault; full author onboarding stays out of scope.Out of scope (future)
Verification
npm run verify— astro check (0 errors), ESLint (clean), Prettier (clean), 31 vitest tests passnpm run build— produces/write; a synthetic all-blocks post was built through the real MDX pipeline and confirmed to render KaTeX, Figure, zebra Table, Video, and separator (throwaway post removed before commit)Test locally with
npm run dev→http://localhost:4321/write.