refactor: add ChoiceLoader for blog template overrides + update shared_lib
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 44s
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:
9
app.py
9
app.py
@@ -1,7 +1,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
import path_setup # noqa: F401 # adds shared_lib to sys.path
|
import path_setup # noqa: F401 # adds shared_lib to sys.path
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from quart import g, request
|
from quart import g, request
|
||||||
|
from jinja2 import FileSystemLoader, ChoiceLoader
|
||||||
from sqlalchemy import select
|
from sqlalchemy import select
|
||||||
|
|
||||||
from shared.factory import create_base_app
|
from shared.factory import create_base_app
|
||||||
@@ -49,6 +51,13 @@ async def coop_context() -> dict:
|
|||||||
def create_app() -> "Quart":
|
def create_app() -> "Quart":
|
||||||
app = create_base_app("coop", context_fn=coop_context)
|
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 ---
|
# --- blueprints ---
|
||||||
app.register_blueprint(register_auth_bp())
|
app.register_blueprint(register_auth_bp())
|
||||||
|
|
||||||
|
|||||||
Submodule shared_lib updated: 39803578af...a1e11c10d4
Reference in New Issue
Block a user