From ea61924c2ca24c4b284bde073e09077f32e60c7f Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 10 Feb 2026 10:54:59 +0000 Subject: [PATCH] refactor: add ChoiceLoader for blog template overrides + update shared_lib Co-Authored-By: Claude Opus 4.6 --- app.py | 9 +++++++++ shared_lib | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index caada1d..f921376 100644 --- a/app.py +++ b/app.py @@ -1,7 +1,9 @@ from __future__ import annotations import path_setup # noqa: F401 # adds shared_lib to sys.path +from pathlib import Path from quart import g, request +from jinja2 import FileSystemLoader, ChoiceLoader from sqlalchemy import select from shared.factory import create_base_app @@ -49,6 +51,13 @@ async def coop_context() -> dict: def create_app() -> "Quart": app = create_base_app("coop", context_fn=coop_context) + # App-specific templates override shared templates + app_templates = str(Path(__file__).resolve().parent / "templates") + app.jinja_loader = ChoiceLoader([ + FileSystemLoader(app_templates), + app.jinja_loader, + ]) + # --- blueprints --- app.register_blueprint(register_auth_bp()) diff --git a/shared_lib b/shared_lib index 3980357..a1e11c1 160000 --- a/shared_lib +++ b/shared_lib @@ -1 +1 @@ -Subproject commit 39803578af348c1ff24c0bb42642d4a98af70027 +Subproject commit a1e11c10d41e15bf009f5189a09db9700688fa60