Add custom homepage template

This commit is contained in:
2025-07-07 17:29:34 +09:00
parent 00b4769ed9
commit 1900be4c0e
5 changed files with 310 additions and 4 deletions

View File

@@ -177,6 +177,7 @@ class AppConfig:
abuse_email = environ.var("")
security_email = environ.var("")
admin_contact = environ.var("")
_UPPER_CASE = "".join(map(chr, range(ord("A"), ord("Z")+1)))
@@ -215,6 +216,8 @@ def create_app() -> quart.Quart:
app.config["SESSION_COOKIE_SECURE"] = True
app.config["SESSION_COOKIE_SAMESITE"] = "Lax"
app.config["ADMIN_CONTACT"] = config.admin_contact
app.context_processor(proc)
app.register_error_handler(
aiohttp.ClientConnectorError,
@@ -230,11 +233,11 @@ def create_app() -> quart.Quart:
)
@app.route("/")
async def index() -> werkzeug.Response:
async def index() -> typing.Union[str, werkzeug.Response]:
if infra.client.has_session:
return redirect(url_for('user.index'))
return redirect(url_for("user.index"))
return redirect(url_for('main.login'))
return await render_template("home.html")
@app.route("/site.webmanifest")
def site_manifest() -> quart.Response: