From 1a3398dcf36d4d2f972844cabeb4d98d0555a98b Mon Sep 17 00:00:00 2001 From: Starfall Date: Fri, 29 Oct 2021 17:33:57 -0500 Subject: strike: fix crash when subdirectories exist --- README | 1 + sample/blog/subdir/index.html | 1 + strike.py | 2 ++ 3 files changed, 4 insertions(+) create mode 100644 sample/blog/subdir/index.html diff --git a/README b/README index e1418e7..dd6448e 100644 --- a/README +++ b/README @@ -16,6 +16,7 @@ Strike has simple goals: And some stretch goals: * Create an extra page listing all generated pages in order of creation date (newest first) + * As above, but as an RSS feed * Add links to next & previous generated pages * Turn the extra page into a flexible component that can be added into any other page * Use different templates on different files diff --git a/sample/blog/subdir/index.html b/sample/blog/subdir/index.html new file mode 100644 index 0000000..b66efd5 --- /dev/null +++ b/sample/blog/subdir/index.html @@ -0,0 +1 @@ +This file in a subdirectory of the input directory should also be processed. diff --git a/strike.py b/strike.py index 73c91de..8faeab3 100755 --- a/strike.py +++ b/strike.py @@ -56,6 +56,8 @@ def main(): output_dir.mkdir(parents=True, exist_ok=True) for file in os.listdir(input_dir): + if (input_dir/file).is_dir(): + continue if file in exclusions: continue contents, meta = handle_file(input_dir/file) -- cgit