summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/blogpost_processor.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/blogpost_processor.py b/modules/blogpost_processor.py
index a8833e2..f8c06c2 100644
--- a/modules/blogpost_processor.py
+++ b/modules/blogpost_processor.py
@@ -216,10 +216,13 @@ class Post:
return None
-def get_posts(path: str) -> list[Post]:
+def get_posts(path: str, local: bool) -> list[Post]:
return_list = []
for directory in os.listdir(path):
+ if directory.endswith(".unpublished") and not local:
+ continue
+
return_list.append(Post(os.path.join(path, directory)))
return_list.sort(key=lambda post: post.meta_data[PUBLISH_DATE_KEY], reverse=True)