FATHOM-DM / agents /master /templates.py
aarushgupta's picture
Deploy FATHOM-DM Space bundle
2803d7e verified
from __future__ import annotations
from pathlib import Path
DIST_INDEX = Path(__file__).resolve().parents[2] / "www" / "dist" / "index.html"
def render_index() -> str:
if DIST_INDEX.is_file():
return DIST_INDEX.read_text(encoding="utf-8")
return """<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Viewer Not Built</title>
<style>
body {
margin: 0;
min-height: 100vh;
display: grid;
place-items: center;
font-family: ui-monospace, Menlo, Monaco, monospace;
background: #0a0d14;
color: #e7ebf2;
}
main {
max-width: 48rem;
padding: 2rem;
}
code {
color: #ffd86b;
}
</style>
</head>
<body>
<main>
<h1>Frontend build not found.</h1>
<p>Run <code>npm run dev</code> for the Vite app or <code>npm run build</code> to let the Python server serve the built site from <code>www/dist</code>.</p>
</main>
</body>
</html>
"""