updated cli serve interface
This commit is contained in:
parent
cefd57d8d7
commit
3b32352ba6
1 changed files with 27 additions and 4 deletions
|
@ -59,9 +59,7 @@ def build(
|
||||||
"""
|
"""
|
||||||
if draft:
|
if draft:
|
||||||
print("Option override: including drafts.")
|
print("Option override: including drafts.")
|
||||||
builder = ZonaBuilder(
|
builder = ZonaBuilder(cli_root=root, cli_output=output, draft=draft)
|
||||||
cli_root=root, cli_output=output, draft=draft
|
|
||||||
)
|
|
||||||
builder.build()
|
builder.build()
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,6 +71,16 @@ def serve(
|
||||||
help="Directory containing config.yml",
|
help="Directory containing config.yml",
|
||||||
),
|
),
|
||||||
] = None,
|
] = None,
|
||||||
|
host: Annotated[
|
||||||
|
str,
|
||||||
|
typer.Option("--host", help="Hostname for live preview server."),
|
||||||
|
] = "localhost",
|
||||||
|
port: Annotated[
|
||||||
|
int,
|
||||||
|
typer.Option(
|
||||||
|
"--port", "-p", help="Port number for live preview server."
|
||||||
|
),
|
||||||
|
] = 8000,
|
||||||
output: Annotated[
|
output: Annotated[
|
||||||
Path | None,
|
Path | None,
|
||||||
typer.Option(
|
typer.Option(
|
||||||
|
@ -83,6 +91,14 @@ def serve(
|
||||||
bool,
|
bool,
|
||||||
typer.Option("--draft", "-d", help="Include drafts."),
|
typer.Option("--draft", "-d", help="Include drafts."),
|
||||||
] = False,
|
] = False,
|
||||||
|
no_live_reload: Annotated[
|
||||||
|
bool,
|
||||||
|
typer.Option(
|
||||||
|
"--no-live-reload",
|
||||||
|
"-n",
|
||||||
|
help="Don't automatically reload web preview.",
|
||||||
|
),
|
||||||
|
] = False,
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Build the website and start a live preview server.
|
Build the website and start a live preview server.
|
||||||
|
@ -93,7 +109,14 @@ def serve(
|
||||||
"""
|
"""
|
||||||
if draft:
|
if draft:
|
||||||
print("Option override: including drafts.")
|
print("Option override: including drafts.")
|
||||||
server.serve(root, output, draft)
|
server.serve(
|
||||||
|
root=root,
|
||||||
|
output=output,
|
||||||
|
draft=draft,
|
||||||
|
host=host,
|
||||||
|
port=port,
|
||||||
|
live_reload=not no_live_reload,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue