mirror of
https://github.com/kennethreitz/kennethreitz.org.git
synced 2026-06-05 22:50:17 +00:00
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:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user