From a868b0a8a358ed12059be676b6e61faefde4dfdc Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 10 Feb 2026 01:36:54 +0000 Subject: [PATCH] fix: add app-specific templates dir to Jinja loader App templates must override shared templates so calendar pages can skip the post-specific meta block. Co-Authored-By: Claude Opus 4.6 --- app.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app.py b/app.py index 12db8b6..3331f9c 100644 --- a/app.py +++ b/app.py @@ -1,8 +1,10 @@ from __future__ import annotations import path_setup # noqa: F401 # adds shared_lib to sys.path +from pathlib import Path from quart import g +from jinja2 import FileSystemLoader, ChoiceLoader from shared.factory import create_base_app @@ -40,6 +42,13 @@ async def events_context() -> dict: def create_app() -> "Quart": app = create_base_app("events", context_fn=events_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, + ]) + # Calendars blueprint at root — standalone mode (no post nesting) app.register_blueprint( register_calendars(),