diff --git a/bincio/render/cli.py b/bincio/render/cli.py index e045f7e..de28527 100644 --- a/bincio/render/cli.py +++ b/bincio/render/cli.py @@ -168,6 +168,8 @@ def _link_data(site: Path, data: Path) -> None: help="Deploy after build. Currently supports: github.") @click.option("--handle", default=None, help="(Multi-user) Incrementally re-merge one user's shard only.") +@click.option("--no-build", "no_build", is_flag=True, + help="Skip the Astro build step (just merge sidecars and update manifests).") def render( config_path: Optional[str], data_dir: Optional[str], @@ -176,6 +178,7 @@ def render( serve: bool, deploy: Optional[str], handle: Optional[str], + no_build: bool, ) -> None: """Build (or serve) the BincioActivity static site from a BAS data store.""" @@ -185,9 +188,14 @@ def render( console.print(f"Site: [cyan]{site}[/cyan]") console.print(f"Data: [cyan]{data}[/cyan]") - _ensure_npm(site) _merge_edits(data, handle=handle) _write_root_manifest(data) + + if no_build: + console.print("[green]Data updated.[/green] Skipping Astro build (--no-build).") + return + + _ensure_npm(site) _link_data(site, data) env = {**os.environ, "BINCIO_DATA_DIR": str(data)} diff --git a/bincio/serve/server.py b/bincio/serve/server.py index ba620fb..c861b1a 100644 --- a/bincio/serve/server.py +++ b/bincio/serve/server.py @@ -175,7 +175,8 @@ def _trigger_rebuild(handle: str) -> None: [uv, "run", "bincio", "render", "--data-dir", str(data_dir), "--site-dir", str(site_dir), - "--handle", handle], + "--handle", handle, + "--no-build"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, ) diff --git a/docs/deployment/vps.md b/docs/deployment/vps.md index 921be5e..5b79f92 100644 --- a/docs/deployment/vps.md +++ b/docs/deployment/vps.md @@ -253,6 +253,17 @@ server { add_header Cache-Control "no-cache, must-revalidate"; } + # Activity detail pages: fall back to the dynamic shell for activities uploaded + # after the last site build (avoids 404 while waiting for a rebuild). + location /activity/ { + try_files $uri $uri/ /activity/index.html; + } + + # Per-user profile pages: same fallback for new users. + location /u/ { + try_files $uri $uri/ =404; + } + # Static files location / { try_files $uri $uri/ $uri.html =404; diff --git a/site/src/components/ActivityDetailLoader.svelte b/site/src/components/ActivityDetailLoader.svelte new file mode 100644 index 0000000..a0482c7 --- /dev/null +++ b/site/src/components/ActivityDetailLoader.svelte @@ -0,0 +1,40 @@ + + +{#if loading} +

Loading activity…

+{:else if notFound} +
+

Activity not found.

+

It may still be processing — try refreshing in a moment.

+ ← Back to feed +
+{:else if activity} + +{/if} diff --git a/site/src/pages/activity/index.astro b/site/src/pages/activity/index.astro new file mode 100644 index 0000000..453a95d --- /dev/null +++ b/site/src/pages/activity/index.astro @@ -0,0 +1,7 @@ +--- +import Base from '../../layouts/Base.astro'; +import ActivityDetailLoader from '../../components/ActivityDetailLoader.svelte'; +--- + + +