diff options
author | Starfall <us@starfall.systems> | 2021-10-29 17:33:57 -0500 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2023-12-05 10:00:58 -0600 |
commit | 1a3398dcf36d4d2f972844cabeb4d98d0555a98b (patch) | |
tree | 71c90d4b8adbe7033a58a301d1d43a6b5accc4ef | |
parent | 287ff07313c095fed38d26a81db878337fb2d541 (diff) |
strike: fix crash when subdirectories exist
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | sample/blog/subdir/index.html | 1 | ||||
-rwxr-xr-x | strike.py | 2 |
3 files changed, 4 insertions, 0 deletions
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) |