Skip to content

Instantly share code, notes, and snippets.

@judell
Last active March 25, 2026 18:45
Show Gist options
  • Select an option

  • Save judell/259047b35032c5c6b9d3babea47895fc to your computer and use it in GitHub Desktop.

Select an option

Save judell/259047b35032c5c6b9d3babea47895fc to your computer and use it in GitHub Desktop.

The published blog at blog.xmlui.org is a standalone XMLUI app (xmlui-blog), separate from the main website. Its source lived in blog/src/ but has been removed from the working tree — only blog/dist/ remains.

The key file was blog/src/config.ts, which contains:

  1. A hardcoded blogPosts array listing every post's metadata (title, slug, description, author, date, image, tags, draft).
  2. That array is passed to the XMLUI runtime via appGlobals.blog.posts.
  3. Blog markdown files are loaded from blog/public/blog/*.md via Vite glob import.
  4. The Main.xmlui for the blog app used hardcoded Page routes with index-based references (posts[0], posts[1], etc.).

Adding a new post to the published blog requires:

  • Adding the markdown file to blog/public/blog/
  • Adding an entry to the blogPosts array in blog/src/config.ts
  • Adding a new Page route in blog/src/Main.xmlui
  • Rebuilding with xmlui build

Frontmatter in the markdown files is not used. The metadata lives entirely in the hardcoded array in config.ts.

The website architecture (partially built)

The website/ directory has a newer architecture that was intended to replace the standalone blog app. It has:

  • Blog markdown files with YAML frontmatter in website/content/blog/
  • website/utils/index.ts extracts frontmatter via buildContentFromRuntime() into a blogFrontmatter object, and uses it for draft filtering and search indexing
  • website/src/Main.xmlui has dynamic routing (/blog/:slug) instead of hardcoded per-post routes
  • A native Blog component (packages/xmlui-docs-blocks/src/blog/BlogNative.tsx) that reads from appGlobals.blog.posts and handles listing + individual post display

What's missing: The blogFrontmatter extracted in utils/index.ts is never converted to a posts array, never exported, and never wired into appGlobals.blog in website/src/config.ts. So posts is undefined at runtime and no blog posts appear.

What needs to happen

To complete the transition to frontmatter-based discovery:

  1. In website/utils/index.ts: build a blogPosts array from the already-extracted blogFrontmatter and export it.
  2. In website/src/config.ts: import blogPosts and add it as appGlobals.blog.posts.
  3. Verify that website/src/Main.xmlui blog routes work with the dynamic :slug routing and the Blog or BlogOverview/BlogPage components.
  4. Blog images go in website/public/resources/blog/images/.

After that, adding a new post should be: drop a markdown file with frontmatter into website/content/blog/ and rebuild. No config changes needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment