lettuce serve-site
lettuce serve-site
Preview the built site locally over HTTP.
lettuce serve-site [dir] [--port N]
The directory to serve is a positional argument (default _site). It binds to 127.0.0.1 and prints:
Serving <dir> at http://127.0.0.1:<port>
Options
| Flag | Default | Notes |
|---|---|---|
--port N |
8000 | Listen port |
Examples
Preview after a publish:
lettuce publish && lettuce serve-site
Serve on a different port:
lettuce serve-site --port 9000
What it does
lettuce serve-site is built on FileMiddleware:
Serves the static files in the directory.
Resolves
index.htmlfor directory requests (the same search-as-home page the published site uses).
Serve a different folder
To serve a folder that isn’t the default _site:
lettuce serve-site /path/to/other-site
Stop it
Ctrl-C in the terminal. There’s no daemon mode for serve-site — it’s intentionally tied to a foreground terminal session for preview workflows.