Mirror the URL space in the frontend build layout

Build with assetsDir: '_/assets' so hashed assets land under
frontend-build/_/assets/ and favicon.ico (from frontend/public) at the
build root, then serve the whole build directory at the site root again
(frontend.route(app, "/"), cached="/_/assets/"). The explicit
favicon route is dropped — the Frontend serves it as an ordinary
unhashed (no-cache) file. Manifest paths now carry the _/assets/
prefix, so views.py only prepends a slash.
This commit is contained in:
2026-08-16 16:22:39 +00:00
parent d5e40fba12
commit 508795437f
5 changed files with 30 additions and 30 deletions
+5 -4
View File
@@ -243,8 +243,9 @@ def _page_assets() -> tuple[list[str], list[str]]:
)
manifest = json.loads((BUILD / ".vite/manifest.json").read_text())
entry = manifest["src/pagerite.js"]
styles = [f"/_/assets/{css}" for css in entry.get("css", [])]
return [f"/_/assets/{entry['file']}"], styles
# Manifest paths already carry the _/assets/ prefix (assetsDir).
styles = [f"/{css}" for css in entry.get("css", [])]
return [f"/{entry['file']}"], styles
def _editor_assets() -> tuple[list[str], list[str]]:
@@ -260,8 +261,8 @@ def _editor_assets() -> tuple[list[str], list[str]]:
)
manifest = json.loads((BUILD / ".vite/manifest.json").read_text())
entry = manifest["src/main.js"]
styles = [f"/_/assets/{css}" for css in entry.get("css", [])]
return [f"/_/assets/{entry['file']}"], styles
styles = [f"/{css}" for css in entry.get("css", [])]
return [f"/{entry['file']}"], styles
def render_editor() -> str: