Skip to content

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
SlimeVR:maya/newsfrom
Depact:maya/news-Depact-squash
Closed

Conversation

@Depact

@Depact Depact commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

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.

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.json etc.) 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

  • Post system: Posts moved from src/routes/news/posts/ to public/posts/<slug>/<slug>.md. Generated index.json (metadata) + index-N.json (20 posts/page, 3 pages, 49 posts total)
  • Components: NewsCard, NewsPostContent (SolidMarkdown + rehype-raw), NewsList (paginated with dynamic page fetching), EmojiText, FormattedDate, NewsPageHeader, NewsPostHeader
  • Emoji: Discord-style <:name:id> rendered as webp images from /posts/emoji/. Supported in post content and card descriptions
  • Images: loading="lazy" on all images — emoji, markdown content, and card thumbnails
  • Deps: rehype-raw@6.1.1 (matches unified@10/vfile@5 used by solid-markdown), tsx for script runner
  • Cleanup: Renamed markdown.tsmarkdown.helper.ts, formatted prose classes with clsx

@Depact
Depact changed the base branch from main to maya/news July 23, 2026 18:38
@Depact Depact closed this Jul 23, 2026
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