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:
- A hardcoded
blogPostsarray listing every post's metadata (title, slug, description, author, date, image, tags, draft). - That array is passed to the XMLUI runtime via
appGlobals.blog.posts. - Blog markdown files are loaded from
blog/public/blog/*.mdvia Vite glob import. - The
Main.xmluifor the blog app used hardcodedPageroutes 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
blogPostsarray inblog/src/config.ts - Adding a new
Pageroute inblog/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/ 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.tsextracts frontmatter viabuildContentFromRuntime()into ablogFrontmatterobject, and uses it for draft filtering and search indexingwebsite/src/Main.xmluihas dynamic routing (/blog/:slug) instead of hardcoded per-post routes- A native
Blogcomponent (packages/xmlui-docs-blocks/src/blog/BlogNative.tsx) that reads fromappGlobals.blog.postsand 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.
To complete the transition to frontmatter-based discovery:
- In
website/utils/index.ts: build ablogPostsarray from the already-extractedblogFrontmatterand export it. - In
website/src/config.ts: importblogPostsand add it asappGlobals.blog.posts. - Verify that
website/src/Main.xmluiblog routes work with the dynamic:slugrouting and theBlogorBlogOverview/BlogPagecomponents. - 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.