Files
lair.moe/blueprints/root/__init__.py
T
Sweetbread 75525b4d57 Add some webrings
Difficult euroring parsing was made by GPT too. Its realisation is
horror
2026-04-09 04:38:52 +03:00

32 lines
656 B
Python

from htmlmin import minify
from flask import Blueprint, render_template, request, jsonify
from .modules.euroring import data as euroring_data, refresh_cache as euroring_refresh
bp = Blueprint(
"root",
__name__,
template_folder="templates",
static_folder="static"
)
def render_tmpl(filename: str) -> str:
euroring_refresh()
return minify(
render_template(filename, euroring=euroring_data),
remove_empty_space=True
)
@bp.route("/")
def index():
return render_tmpl('index.pug')
@bp.route("/host")
def host():
return render_tmpl('host.pug')
@bp.route("/us")
def us():
return render_tmpl('us.pug')