fix: inject post data into template context for post header row
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 36s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 36s
The post header bar needs `post` in the template context to render the page link, feature image, and nav. Added context processor to spread g.post_data into templates, matching the events app pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
7
app.py
7
app.py
@@ -124,6 +124,13 @@ def create_app() -> "Quart":
|
|||||||
abort(404)
|
abort(404)
|
||||||
g.market = market
|
g.market = market
|
||||||
|
|
||||||
|
@app.context_processor
|
||||||
|
async def inject_post():
|
||||||
|
post_data = getattr(g, "post_data", None)
|
||||||
|
if not post_data:
|
||||||
|
return {}
|
||||||
|
return {**post_data}
|
||||||
|
|
||||||
# --- Root route: market listing ---
|
# --- Root route: market listing ---
|
||||||
@app.get("/")
|
@app.get("/")
|
||||||
async def markets_listing():
|
async def markets_listing():
|
||||||
|
|||||||
Reference in New Issue
Block a user