Replaces the compile-time vite-plugin-markdown post system with runtime SolidMarkdown rendering and paginated JSON manifests. Adds Discord emoji rendering and lazy image loading. - #42
Closed
Depact wants to merge 3 commits into
Conversation
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
Replaces the compile-time
vite-plugin-markdownpost system with runtimeSolidMarkdownrendering and paginated JSON manifests. Adds Discord emoji rendering and lazy image loading.Why runtime instead of compile-time?
With
import.meta.glob+vite-plugin-markdown, every post's HTML is bundled into the JS at build time. Loading would require shipping all posts to the client upfront - defeating pagination's purpose, and pagination is needed for performance. The runtime approach generates static JSON manifests (index-1.jsonetc.) at build time, so each page fetches only its 20 posts on demand. Same build-time generation, but the client loads data lazily instead of bundling everything.Changes
src/routes/news/posts/topublic/posts/<slug>/<slug>.md. Generatedindex.json(metadata) +index-N.json(20 posts/page, 3 pages, 49 posts total)NewsCard,NewsPostContent(SolidMarkdown + rehype-raw),NewsList(paginated with dynamic page fetching),EmojiText,FormattedDate,NewsPageHeader,NewsPostHeader<:name:id>rendered as webp images from/posts/emoji/. Supported in post content and card descriptionsloading="lazy"on all images — emoji, markdown content, and card thumbnailsrehype-raw@6.1.1(matchesunified@10/vfile@5used bysolid-markdown),tsxfor script runnermarkdown.ts→markdown.helper.ts, formatted prose classes withclsx