From f0db4f4ea632914ee427e4b4c0bee1f7ee2121d1 Mon Sep 17 00:00:00 2001 From: giles Date: Sun, 11 Jan 2026 12:54:50 +0000 Subject: [PATCH] Restore home page with README display Instead of redirecting to /runs, show the home page with stats and README. Co-Authored-By: Claude Opus 4.5 --- app/routers/home.py | 25 +++++++++++++++++++------ app/templates/home.html | 8 +++++++- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/app/routers/home.py b/app/routers/home.py index 0d8a4fd..f3e4836 100644 --- a/app/routers/home.py +++ b/app/routers/home.py @@ -2,6 +2,9 @@ Home and root routes for L1 server. """ +from pathlib import Path + +import markdown from fastapi import APIRouter, Request, Depends from fastapi.responses import HTMLResponse, RedirectResponse @@ -16,16 +19,26 @@ router = APIRouter() @router.get("/") async def home(request: Request): """ - Home page - redirect to runs if authenticated, show landing otherwise. + Home page - show README and stats. """ user = await get_current_user(request) - if user: - return RedirectResponse(url="/runs", status_code=302) + # Load README + readme_html = "" + try: + readme_path = Path(__file__).parent.parent.parent / "README.md" + if readme_path.exists(): + readme_html = markdown.markdown(readme_path.read_text()) + except Exception: + pass - # For now, redirect to login at L2 - # TODO: Show a landing page with login link - return RedirectResponse(url="/runs", status_code=302) + templates = get_templates(request) + return render(templates, "home.html", request, + user=user, + readme_html=readme_html, + stats={}, + active_tab="home", + ) @router.get("/login") diff --git a/app/templates/home.html b/app/templates/home.html index 8c1c99e..8189268 100644 --- a/app/templates/home.html +++ b/app/templates/home.html @@ -31,10 +31,16 @@ {% if not user %} -
+

Sign in through your L2 server to access all features.

Sign In →
{% endif %} + + {% if readme_html %} +
+ {{ readme_html | safe }} +
+ {% endif %}
{% endblock %}