diff --git a/edit/server.py b/edit/server.py index 721ee68..8c8d0a3 100644 --- a/edit/server.py +++ b/edit/server.py @@ -200,11 +200,17 @@ def _save(slug: str, body: PageBody, base: Path) -> JSONResponse: path.write_text(body.content, encoding="utf-8") return JSONResponse({"slug": slug, "saved": True}) +_SENTINEL = site_dir / "src" / "_content-sentinel.ts" + def _delete(slug: str, base: Path) -> JSONResponse: path = _slug_to_path(slug, base) if not path.exists(): raise HTTPException(404, "Not found") path.unlink() + # Bump the sentinel to force Astro to re-run all content loaders. + # macOS fsevents never fires unlink events through symlinks, so deleted + # entries stay in the store until a loader re-run prunes them. + _SENTINEL.write_text(f"export const _t = {int(time.time())};\n") return JSONResponse({"slug": slug, "deleted": True}) diff --git a/site b/site index 3ccd551..079460a 160000 --- a/site +++ b/site @@ -1 +1 @@ -Subproject commit 3ccd5511498db9354e32db8bb4b147499154b5aa +Subproject commit 079460a7fa033c1b0098663af9e9b46b66a47b77