refactor: add ChoiceLoader for blog template overrides + update shared_lib
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 44s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-10 10:54:59 +00:00
parent b93bdd0c5a
commit ea61924c2c
2 changed files with 10 additions and 1 deletions

9
app.py
View File

@@ -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())