Serve raw files (images, etc.) from data directory in catch-all

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-22 14:20:35 -04:00
parent dd751105ec
commit efced60c35
+6
View File
@@ -1117,6 +1117,12 @@ async def catch_all(req, resp, *, path):
file_path = DATA_DIR / f"{path}.md"
dir_path = DATA_DIR / path
index_path = dir_path / "index.md"
raw_path = DATA_DIR / path
# Serve raw files (images, etc.) directly from data directory
if raw_path.exists() and raw_path.is_file() and not path.endswith(".md"):
resp.file(str(raw_path))
return
# Serve markdown file
if file_path.exists():