pyssg is pre-1.0 and under active development - APIs, config, and themes may change.
pyssg.cli.serve

1 min read

pyssg.cli.serve

Dev server: watch + incremental rebuild + live reload.

Runs an initial full build, serves the output over HTTP, and watches the content and layout directories. Each filesystem burst triggers an incremental rebuild; the changed output URLs come straight from early-cutoff and bump a reload token that an injected script polls, so only actually-changed pages cause the browser to refresh.

Threading: the watchdog observer and the HTTP server each run on their own thread; the main thread blocks until interrupted.

serve(site_dir: Path, host: str = '127.0.0.1', port: int = 8000, *, no_cache: bool = False) -> None

Build, serve and live-rebuild a site until interrupted.