fix: use is string not is mapping in content-field fallback
Deploy Indiekit Server / deploy (push) Successful in 1m14s

`is mapping` is Jinja2-only — Nunjucks doesn't have it, so the test
always evaluated false, falling through to the raw content object and
rendering as [object Object].

Fix: `_contentFv.text or (_contentFv if _contentFv is string else "")`
correctly handles both object fallback (extracts .text) and string
fallback (validation re-render).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Sven
2026-04-27 09:29:20 +02:00
parent c70a9fe837
commit 872e73077e
@@ -24,7 +24,7 @@ const newSnippet = `{#- ${marker} -#}
{%- set _contentFv = fieldData("content").value -%}
{{ textarea({
name: "content",
value: properties.content.text or (_contentFv.text if _contentFv is mapping else _contentFv) or "",`;
value: properties.content.text or _contentFv.text or (_contentFv if _contentFv is string else ""),`;
async function exists(p) {
try { await access(p); return true; } catch { return false; }