mdcms/docs/unreleased.md
Claude 28b248735f
Patch <title> in index.html with sitename during build
mdcms build now writes the sitename from config.yml into the <title> tag
of index.html. WhatsApp, Slack, and other link-preview crawlers read the
static HTML without executing JavaScript, so the title must be correct in
the raw file. Previously it was blank (or "MD-CMS" in older templates).
2026-05-19 08:37:57 +00:00

2.1 KiB

Unreleased changes

Changes merged into development that have not yet been released to main.


mdcms build patches <title> with sitename

mdcms build now rewrites the <title> tag in index.html with the value of sitename from config.yml. Previously the tag was hardcoded (MD-CMS) in older templates, or blank in the starter template, so link previews in WhatsApp, Slack, and other crawlers that read static HTML showed the wrong name.


Untranslated posts now visible in all categories

Status: On development, pending release.

What was broken

When the category system is enabled, a post file without a category suffix (e.g. posts/my-post.md) was silently assigned to the default category only. Switching to any other category caused those posts to disappear from the nav and from posts-* tag listings — even though no translated version existed. If you wrote posts without a language suffix, they simply vanished the moment a visitor switched category.

Pages without a category suffix are unaffected: they continue to be assigned to the default category, which is the correct behaviour for pages.

What it does now

Posts without a category suffix are treated as uncategorised — meaning they appear in every category. A post called my-post.md now shows up regardless of which category is active. A post called my-post.en.md still appears only in the en category as before.

Mixed situations work as expected: if you have both my-post.md and my-post.nb.md, the Norwegian variant is shown when the nb category is active, and the bare my-post.md is shown for every other category.

What changes in the build output

After rebuilding a site with mdcms build, affected post entries in nav.yml gain an uncategorized: true field:

- file: posts/my-post.md
  title: My Post
  sort: 100
  uncategorized: true

In search.json, these entries carry "category": null instead of the default category code. This is what tells the renderer to include them universally.

A rebuild is required for existing sites to pick up the change.