Afegir metadades per quan es comparteixen enllaços

This commit is contained in:
marc
2025-11-02 14:22:22 +01:00
parent 2fbdbbf290
commit c1ec268823
12 changed files with 1227 additions and 12 deletions

View File

@@ -23,11 +23,17 @@ router = get_router()
@router.get("/tema/{tema_id}")
def page(request: Request, logged_in: auth.LoggedIn, tema_id: int):
tema = temes_q.get_tema_by_id(tema_id)
if not tema:
raise HTTPException(status_code=404, detail="Could not find tune")
tema = scores_service.add_scores_to_tema(tema)
return templates.TemplateResponse(
"index.html",
{
"request": request,
"page_title": "Folkugat",
"page_title": "Folkugat - Tema",
"page_description": tema.title,
"page_card": "",
"content": f"/api/tema/{tema_id}",
"logged_in": logged_in,
}