fix(admin): use collection urlPattern for preview button fallback URL (#181)

* fix(admin): use collection urlPattern for preview button fallback URL

The preview button hardcoded fallback URLs as /${collection}/${slug},
ignoring the collection's urlPattern setting. Collections with custom
URL patterns (e.g. urlPattern: "/biljke/{slug}" on a "biljka" collection)
would open a 404 instead of the correct page.

Thread urlPattern through the manifest and use it in the ContentEditor
preview fallback.

Fixes #167

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Signed-off-by: Filip Ilic <ilic.filip@gmail.com>

* chore: add changeset for preview URL pattern fix

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Signed-off-by: Filip Ilic <ilic.filip@gmail.com>

---------

Signed-off-by: Filip Ilic <ilic.filip@gmail.com>
Co-authored-by: Matt Kane <mkane@cloudflare.com>
This commit is contained in:
Filip Ilić
2026-04-04 21:00:28 +02:00
committed by GitHub
parent 3674d4857a
commit 9d10d2791f
5 changed files with 16 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
---
"@emdash-cms/admin": patch
"emdash": patch
---
fix(admin): use collection urlPattern for preview button fallback URL