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 →