This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Timmy-time-dashboard/src/dashboard/templating.py

13 lines
378 B
Python

"""Shared Jinja2Templates instance for all dashboard routes."""
from pathlib import Path
from fastapi.templating import Jinja2Templates
from config import settings
templates = Jinja2Templates(directory=str(Path(__file__).parent / "templates"))
# Inject site_url into every template so SEO tags and canonical URLs work.
templates.env.globals["site_url"] = settings.site_url