Add image upload support: assets dir, POST /api/assets, editor drop zone

This commit is contained in:
brutsalvadi
2026-05-04 12:21:15 +02:00
parent 0f8bd3dba6
commit 83f48f09d4
4 changed files with 52 additions and 4 deletions
+6
View File
@@ -14,6 +14,7 @@ bincio_wiki/
pages/ wiki content (*.md files the community edits)
_docs/ software documentation (shown as separate section)
blog/ blog/stories content (*.md files)
assets/ user-uploaded images (gitignored; rsync'd to VPS separately)
site/ Astro 6 app (git submodule → brutsalvadi/astro-bloomz)
edit/ FastAPI edit server (Python, port 8001)
pyproject.toml Python dependencies (managed by uv)
@@ -39,6 +40,11 @@ by `dev.sh --edit` — no manual setup needed. To add a dependency:
without extension, e.g. `digital-garden`)
- Docs section: `pages/_docs/*.md` (IDs start with `_docs/`)
- Blog/stories: `blog/*.md`
- Assets: `assets/` — gitignored, not part of the Astro build. FastAPI serves them
at `/assets/{filename}` in dev (Vite proxies `/assets` → port 8001). On the VPS,
nginx serves `/assets/` directly from the filesystem (rsync'd separately).
Upload via `POST /api/assets` (multipart); returns `{"url": "/assets/filename"}`.
The editor inserts `![name](/assets/filename)` into the markdown on upload.
- Bonsai index: stored in `site/src/content/index/` — the `i.bonsai.md` file
defines the semantic tree structure
- The homepage (`site/src/pages/index.astro`) splits entries by `_docs/` prefix