feat(blog): add MDX-powered post system with content collections#2
Open
edwintantawi wants to merge 4 commits into
Open
feat(blog): add MDX-powered post system with content collections#2edwintantawi wants to merge 4 commits into
edwintantawi wants to merge 4 commits into
Conversation
Split font imports out of app.css into their own stylesheet and preload them from the root route, avoiding render-blocking font loads.
Add createCsrfMiddleware to the start instance so server function requests are validated, independent of any specific route.
Introduce a content-collections pipeline that parses MDX posts under src/content/posts, compiles them via @mdx-js/rollup, and streams the rendered output through React Server Components so the compiled MDX never ships to the client bundle. - content-collections.ts defines the `posts` collection, validated against post.schema.ts and enriched with git-derived last-modified timestamps (modules/markdown/utils.ts). - modules/post exposes server functions to list and load posts, used by the new /posts and /posts/$slug routes. - vite.config.ts wires up the MDX plugin, content-collections vite plugin, and RSC support (needed to stream MDX without eval on Workers), and enables typography via @tailwindcss/typography. - Generalize the i18n pathname/prerender helpers (lib/i18n/utils.ts) to accept an arbitrary route list instead of a fixed config object, so the new /posts routes can be prerendered per locale alongside /.
🚀 Preview Deployment (2)Your changes have been deployed to a preview environment:
🏗️ This comment updates automatically with each push. |
…osts Introduce a series content type on top of the existing MDX pipeline: - Add `series` and `seriesPost` content collections with frontmatter validation, numeric order prefixes, and integrity checks that reject duplicate orders and posts orphaned by a missing `_index.mdx`. - Add the series module (server functions, schema, types) exposing list, detail, and post loaders backed by RSC-streamed MDX. - Add /series, /series/$slug, and /series/$slug/$postSlug routes plus a home-page nav link and the /series prerender path. - Move markdown-style-guide.mdx into a markdown series and add sample frontend-development series content.
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.
Summary
/postsand/posts/$slugroutes backed by server functions inmodules/post/postsprerenders per locale alongside/Test plan
vp check(format, lint, type check)vp testvp dev— verify/,/posts, and/posts/markdown-style-guiderender correctly in both locales