Wire sx_content through full read/write pipeline

Model: add sx_content column to Post. Writer: accept sx_content in
create_post, create_page, update_post. Routes: read sx_content from form
data in new post, new page, and edit routes. Read pipeline: ghost_db
includes sx_content in public dict, detail/home views prefer sx_content
over html when available, PostDTO includes sx_content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 23:22:30 +00:00
parent 341fc4cf28
commit 7ccb463a8b
9 changed files with 34 additions and 6 deletions

View File

@@ -716,11 +716,13 @@ def _post_main_panel_sx(ctx: dict) -> str:
fi = post.get("feature_image")
html_content = post.get("html", "")
sx_content = post.get("sx_content", "")
return sx_call("blog-detail-main",
draft=SxExpr(draft_sx) if draft_sx else None,
chrome=SxExpr(chrome_sx) if chrome_sx else None,
feature_image=fi, html_content=html_content,
sx_content=SxExpr(sx_content) if sx_content else None,
)
@@ -770,10 +772,13 @@ def _post_meta_sx(ctx: dict) -> str:
# ---------------------------------------------------------------------------
def _home_main_panel_sx(ctx: dict) -> str:
"""Home page content — renders the Ghost page HTML."""
"""Home page content — renders the Ghost page HTML or sx_content."""
post = ctx.get("post") or {}
html = post.get("html", "")
return sx_call("blog-home-main", html_content=html)
sx_content = post.get("sx_content", "")
return sx_call("blog-home-main",
html_content=html,
sx_content=SxExpr(sx_content) if sx_content else None)
# ---------------------------------------------------------------------------