Compare commits

...

3 commits

Author SHA1 Message Date
dc11436076 wip: templates cli
Some checks failed
/ test-build (push) Failing after 20s
2025-07-18 00:41:20 -04:00
182b30a4ef fix: rss feed is no longer written to content directory
Some checks failed
/ test-build (push) Failing after 19s
2025-07-18 00:41:04 -04:00
312818d8a6 doc: updated changelog
Some checks failed
/ test-build (push) Failing after 18s
2025-07-18 00:38:32 -04:00
3 changed files with 30 additions and 1 deletions

View file

@ -3,6 +3,7 @@
- Added RSS feed generation.
- Added default post description to configuration.
- Added time-of-day support to post `date` frontmatter parsing.
- `zona init` now only writes `footer.md` to the templates directory.
# 1.2.1

View file

@ -229,7 +229,7 @@ class ZonaBuilder:
self._build()
if self.config.feed.enabled:
rss = self.generate_feed()
path = self.layout.content / self.config.feed.path
path = self.layout.output / self.config.feed.path
util.ensure_parents(path)
path.write_bytes(rss)
self.fresh = False

View file

@ -135,6 +135,34 @@ def serve(
)
@app.command()
def templates(
templates: Annotated[
list[str] | None,
typer.Argument(
help="List of included templates to copy. Suffix .html is optional. Argument is required unless --all is given.",
show_default=False,
),
] = None,
all: Annotated[
bool,
typer.Option(
"-a", "--all", help="Write all included templates."
),
] = False,
):
if not all and not templates:
raise typer.BadParameter(
"Must provide template names unless --all is specified."
)
if not all:
assert templates
for t in templates:
print(t)
else:
print("we do it")
def version_callback(value: bool):
if value:
print(f"Zona version: {__version__('zona')}")