server now includes drafts by default
This commit is contained in:
parent
bdd7558999
commit
8d17572d12
3 changed files with 15 additions and 9 deletions
|
@ -91,9 +91,9 @@ def serve(
|
|||
help="Location to write built website. Temporary directory by default.",
|
||||
),
|
||||
] = None,
|
||||
draft: Annotated[
|
||||
final: Annotated[
|
||||
bool,
|
||||
typer.Option("--draft", "-d", help="Include drafts."),
|
||||
typer.Option("--final", "-f", help="Don't include drafts."),
|
||||
] = False,
|
||||
no_live_reload: Annotated[
|
||||
bool,
|
||||
|
@ -111,12 +111,14 @@ def serve(
|
|||
|
||||
Optionally specify the ROOT and OUTPUT directories.
|
||||
"""
|
||||
if draft:
|
||||
print("Option override: including drafts.")
|
||||
if final:
|
||||
print("Preview without drafts.")
|
||||
else:
|
||||
print("Preview with drafts.")
|
||||
server.serve(
|
||||
root=root,
|
||||
output=output,
|
||||
draft=draft,
|
||||
draft=not final,
|
||||
host=host,
|
||||
port=port,
|
||||
live_reload=not no_live_reload,
|
||||
|
|
|
@ -168,7 +168,7 @@ class ZonaReloadHandler(FileSystemEventHandler):
|
|||
def serve(
|
||||
root: Path | None = None,
|
||||
output: Path | None = None,
|
||||
draft: bool = False,
|
||||
draft: bool = True,
|
||||
host: str = "localhost",
|
||||
port: int = 8000,
|
||||
live_reload: bool = True,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue