From 1a716f38d6999f6d7abc90eab3967cee11d4481b Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Fri, 18 Jul 2025 00:37:40 -0400 Subject: [PATCH 1/4] wip: templates cli --- src/zona/cli.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/zona/cli.py b/src/zona/cli.py index da15a22..442e299 100644 --- a/src/zona/cli.py +++ b/src/zona/cli.py @@ -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')}") From 312818d8a6e098494e2f5254cfbd1240b2b7cd84 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Fri, 18 Jul 2025 00:38:32 -0400 Subject: [PATCH 2/4] doc: updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 269d2ab..9f6eed9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 From 182b30a4efcd4e9c9898a84b511bedf904afad00 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Fri, 18 Jul 2025 00:41:04 -0400 Subject: [PATCH 3/4] fix: rss feed is no longer written to content directory --- src/zona/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zona/builder.py b/src/zona/builder.py index 37a3bd1..dd9509f 100644 --- a/src/zona/builder.py +++ b/src/zona/builder.py @@ -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 From dc114360767cc3af1529cf8e9f13ad4ed70694df Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Fri, 18 Jul 2025 00:37:40 -0400 Subject: [PATCH 4/4] wip: templates cli --- src/zona/cli.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/zona/cli.py b/src/zona/cli.py index da15a22..442e299 100644 --- a/src/zona/cli.py +++ b/src/zona/cli.py @@ -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')}")