From d0a7adaf5ab585d1d1d4cd0bc5e52c3f2786a6bc Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Tue, 19 Nov 2024 00:09:51 -0500 Subject: [PATCH] fix: skip documents with no template attribute --- blogue/build.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/blogue/build.py b/blogue/build.py index c2fae16..69a0eeb 100644 --- a/blogue/build.py +++ b/blogue/build.py @@ -48,6 +48,12 @@ def build_site( current_document.source_locator.stem + ".html" ) + if "template" not in current_metadata: + logger.warning( + f"Skipped {current_document.source_locator.name}, no template attribute." + ) + continue + with open(target_path, "w") as out: rendered = renderer.render( str(current_metadata["template"]),