Home intro from retoor as editable site_intro setting; fix settings upsert

This commit is contained in:
2026-10-05 11:12:18 +02:00
parent 3fb47bf401
commit bbdecdc95b
14 changed files with 131 additions and 16 deletions
+6 -2
View File
@@ -3,8 +3,10 @@ from fastapi import APIRouter, Request
from molodetz import config
from molodetz.cache import TTLCache
from molodetz.database import count_media, published_posts
from molodetz.constants import SITE_INTRO_SEED
from molodetz.database import count_media, get_setting, published_posts
from molodetz.gallery import gallery_items
from molodetz.rendering import render_content
from molodetz.responses import respond
from molodetz.schemas.posts import HomeOut
from molodetz.seo import base_seo_context, organization_schema, website_schema
@@ -39,4 +41,6 @@ async def index(request: Request):
description_for("home"),
schemas=[website_schema(request), organization_schema(request)],
)
return respond(request, "home.html", {**blocks, "seo": seo}, model=HomeOut)
intro = get_setting("site_intro", SITE_INTRO_SEED)
ctx = {**blocks, "intro": intro, "intro_html": render_content(intro), "seo": seo}
return respond(request, "home.html", ctx, model=HomeOut)