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:
@@ -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)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user