Add convert_times function to jinja2

(useful, if you want to include times in templates)
This commit is contained in:
magmaus3 2022-10-30 12:55:24 +01:00
parent b1a56edc57
commit 1663a060d9
Signed by: magmaus3
GPG key ID: 966755D3F4A9B251

View file

@ -8,6 +8,7 @@ import httpx
import json
import os
import re
from . import utils
basedir = os.path.dirname(__file__)
app = FastAPI()
app.mount("/static", StaticFiles(directory=basedir + "/static"), name="static")
@ -17,6 +18,8 @@ template_env = jinja2.Environment(
auto_reload=True
)
template_env.globals['convert_times'] = utils.convert_times
BASE_URL = "http://make.fangam.es"
THUMB_URL = "https://images.make.fangam.es"